home *** CD-ROM | disk | FTP | other *** search
/ Amiga Tools 4 / Amiga Tools 4.iso / tools / system-tools / c-shell / csh.doc < prev    next >
Text File  |  1996-02-26  |  117KB  |  3,431 lines

  1.  
  2.         INSTRUCTIONS FOR C-SHELL VERSION: 5.48 (September 1995)
  3.         =======================================================
  4.  
  5.   Contents
  6.   --------
  7.  
  8.  
  9.     O.    Installation
  10.     I.    Description (availability, credits, disclaimer)
  11.     II.    Overview of major features
  12.     III.    Restrictions
  13.     IV.    Pipes
  14.     V.    Command Pre-processor
  15.     VI.    Command Line Editing
  16.     VII.    Function Keys
  17.     VIII.    Shell Commands
  18.     IX.    Special Set Variables
  19.     X.    Functions
  20.     XI.    Miscellaneous
  21.     XII.    Example source files
  22.     XIII.    Default values
  23.     XIV.    Object oriented features
  24.     XV.    Keymaps
  25.     XVI.    Scrolling
  26.  
  27.  
  28.  
  29. O.  Installation
  30. ----------------
  31.  
  32. This program requires at least AmigaOS 2.04 (KS37.175, WB37.67) or higher.
  33.  
  34. For  online  help  inside csh, assign CSH:  somewhere and put csh.doc there.
  35. Then  you can use the 'man' command for any desired command.  Press the HELP
  36. key for a command list.
  37.  
  38. You  can  simply  invoke  csh  from  the  command line or at the end of your
  39. startup-sequence,  because  csh is, from the AmigaDOS standpoint, not a true
  40. shell  like  l:shell-seg.   Nevertheless, csh is 'pure', so if your archiver
  41. forgot to set the 'p' bit, do it right now.
  42.  
  43. Proposed final setup:  If you want to make csh resident, do the following:
  44.  
  45.   1. Copy csh anywhere on your (hard)disk, e.g. dh1:tools
  46.   2. Make sure your s:startup-sequence contains:
  47.     resident dh1:tools/csh add
  48.     csh
  49.   4. In s:.login, put any commands to be called only once, like setmap,
  50.     assign, setclock. This is a shell script, use # for comments, and
  51.     don't use .key type commands.
  52.   5. In s:.cshrc, you put any commands that need to be executed on every
  53.     invocation, like 'alias', 'set' and so on.
  54.   6. Put the following to s:cli-startup and s:shell-startup, so csh will be
  55.     started in any window opened by NewCLI, NewShell or from workbench:
  56.         csh
  57.         endcli
  58.  
  59.  
  60. Additionally,  I  recommend  to assign CSH:  somewhere and put your docs and
  61. CShell scripts there.  You can do the assign from inside the shell, it's not
  62. needed at startup.
  63.  
  64. The file s:.cshrc is executed on every startup (of csh) if it exists,
  65. the file s:.login only on csh's first invocation after boot-time,
  66. the file s:.logout is executed on every termination (of csh).
  67.  
  68.  
  69.  
  70. I.  DESCRIPTION
  71. ---------------
  72.  
  73. This version of Shell is the successor of:
  74.     Shell V2.04 (C)Copyright 1986, Matthew Dillon, All Rights Reserved
  75.     Shell V2.04M-V2.07M by Steve Drew
  76.     Shell V2.08MI, V3.xxA and V4.xxA by Carlo Borreo & Cesare Dieni
  77.     Shell V5.xxL by U. Dominik Mueller
  78.     Shell V5.20+ by Andreas M. Kirchwitz
  79.  
  80.  
  81.  
  82. Responsible for the V5.20+ series of Cshell is:
  83.  
  84.     Andreas M. Kirchwitz
  85.     Seesener Str. 69
  86.     D-10709 Berlin
  87.     Germany
  88.  
  89.     UUCP/Internet: csh-fan@zikzak.in-berlin.de
  90.                 or csh-fan@zikzak.snafu.de
  91.  
  92. Send wishes, detailed bug reports (and the beer bottles :) to the above
  93. address. Postcards welcome!
  94.  
  95. For bug reports, I need your Csh version number and a reproducable bug
  96. generation example.
  97.  
  98. If you report Enforcer hits please send the complete Enforcer and SegTracker
  99. output. Otherwise it's of no earthly use.
  100.  
  101. The V5.20+ series is an ARP-free, OS-2.x-only pre-6.0 version of Cshell.
  102. It only has an english ascii-doc, but it sweetens the time until Csh 6.x
  103. (by Urban Mueller) is available (whenever this might be ;-)
  104.  
  105. Please check the 'restrictions' chapter before reporting any bugs and add
  106. your CShell version and a description of your configuration.
  107.  
  108. You may distribute this program unmodified and for non-profit only.
  109.    *** YOU MAY NOT MODIFY THIS PROGRAM AND REDISTRIBUTE IT ***
  110. Please contact me if you want to make changes.
  111.  
  112.  
  113. AVAILABILITY
  114. ------------
  115.  
  116. CShell can always be downloaded at the AUGL BBS.  Some additionals parts
  117. (French documentation) are available there, too.
  118.  
  119. For those who want to get it per FIDO file request, the archive is always
  120. named like 'csh513.lzh' for CShell 5.13 and 'csh513src.lzh' for its source.
  121.  
  122. CShell is available via FTP from AmiNet ftp.wustl.edu (and mirrors) in the
  123. directory /pub/amiga/shell/ (the archive names are the same) and via E-Mail
  124. from "mail-server@cs.tu-berlin.de" in the same directory.
  125.  
  126.  
  127. CREDITS
  128. -------
  129.  
  130. Arexx is a program by William Hawes.
  131. Cygnus Ed Professional (C) 1988 CygnusSoft Software.
  132.  
  133. Thanks to:
  134.  
  135. Matt Dillon, Steve Drew, Calro Borreo, Cesare Dieni and U. Dominik Mueller
  136. for the previous versions of Csh.
  137.  
  138. Ralph Babel, Eddy Carroll, Gary Duncan, Randell Jesup, Steve Koren, Tim
  139. MacKenzie, Axel Roebel, Mike Schwartz for their code contributions and
  140. suggestions.
  141.  
  142. Michael Beer, Carl Johan Block, Hubert Feyere, Magnus Heldestad, Carsten
  143. Heyl, Alex Liu, Declan McArdle, Svante Eriksson, Luke Mewburn, Peter Orbaek,
  144. Allard Siemelink, Roddi Walker, Shimon Weissman and the unknown Swedish guy
  145. who found the double-LF bug for their bug reports and feedback.
  146.  
  147. Roy Haverman, Martin Horneffer, Hans-Christian Huerlimann, Daniel Pfulg,
  148. Patrizio Rusconi, Christian Schneider and especially Markus Illenseer for
  149. the German translation of the doc.
  150.  
  151. Olivier Berger for the French translation of the doc.
  152.  
  153.  
  154. DISCLAIMER
  155. ----------
  156. Cshell (csh) is © Copyright 1991-1995 by Andreas M. Kirchwitz and all
  157. previous authors mentioned in the "CREDITS" section. All rights reserved.
  158.  
  159. Any possesor of this version of "Cshell (csh)" for the Amiga is hereby
  160. granted a non-exclusive license permitting its use and/or redistribution,
  161. subject to the following terms and conditions.
  162.  
  163. Permission is hereby granted to freely redistribute this version of
  164. "Cshell (csh)" via electronic bulletin board systems (BBS's), freely
  165. redistributable disk collections (such as provided by Fred Fish), service
  166. bureaus (BiX, GEnie, CompuServe, etc), and networks such as USENET, BITNET,
  167. and Internet, provided that such distribution includes this unmodified
  168. License, and all of the documentation files (README and .doc files), in
  169. addition to the executable, and with all copyright notices intact. Access
  170. to the source code must also be available and allowed.
  171.  
  172. This archive may be freely redistributed, but only in totally unchanged
  173. state, i.e. no files can be added, deleted, modified etc. All copyright
  174. notices in the program and its documentation must remain on their places.
  175. Also ".displayme" and other files, usually with "wonderful" ANSI graphics,
  176. so obvious at various BBS's, cannot be added.
  177.  
  178. Use of the "Cshell (csh)" executable and docmentation in any environment,
  179. commercial or otherwise is not restricted, and no fee shall be required for
  180. said use. The use of the source code is also permitted in other freely
  181. redistributable works, provided proper acknowledgement of the authors is
  182. given. The use of the source code in a commercial product is prohibited
  183. without prior written permission of the author.
  184.  
  185. Without prior written permission from the author, it is prohibited to sell or
  186. otherwise convey this version of "Cshell (csh)" for monetary or other forms
  187. of compensation, other than the customery service and/or duplication fees as
  188. may be charged by the distribution mechanisms identified above.
  189.  
  190. It is further prohibited, without prior written permission from the author,
  191. to include this version of "Cshell (csh)" in whole or in part, in the
  192. distribution of any commercial hardware or software package, or component
  193. thereof.
  194.  
  195. This version of "Cshell (csh)" is provided "as is", without express or
  196. implied warranty. The author makes no claim or representation about the
  197. suitability of this software for any purpose.
  198.  
  199. The author disclaims any and all warranties with regard to this software,
  200. including all implied warranties of merchantability and fitness. In no event
  201. shall the author be liable for any special, indirect, or consequential
  202. damages, or any damages whatsoever resulting from loss of use, data, or
  203. profits, whether in an action of contract, negligence, or other tortious
  204. action, arising out of or in connection with the use or performance of this
  205. software.
  206.  
  207.  
  208.  
  209. II. OVERVIEW
  210. ------------
  211.  
  212. Shell provides a convenient AmigaDos alternative command interface.  All its
  213. commands  are internal and thus it does not rely on the c:  commands for any
  214. functionality.
  215.  
  216. Major features include:
  217.     - freely programmable command line editing
  218.     - simple history
  219.     - piping
  220.     - aliases with arguments
  221.     - variables & variable handling (embedded variables)
  222.     - file name expansion via wild carding ('?', '*' and more)
  223.     - conditionals (if/else etc..)
  224.     - source files  (w/ gotos and labels)
  225.     - tab file name completion
  226.     - object oriented features (file classes, actions)
  227.     - many built in commands to speed things up
  228.     - full functionality on VT terminals
  229.  
  230. CShell runs on minimum stack, for recursive aliases and source files better
  231. increase stack to 10K or more.
  232.  
  233. If you use CShell for the first time, remember the following:
  234.     - CShell internal commands must be lowercase & can be abbreviated
  235.     - AmigaDOS command 'Execute' causes some trouble. You cannot
  236.       redirect it, you must not rename it, and you get no return code.
  237.       You can also use 'source' to start your scripts, but you'll have
  238.       to rewrite them a bit. Besides the '.key'-type commands, 'source'
  239.       is downward compatible with 'Execute'.
  240.     - You can always get more information on a command if csh.doc is
  241.       in the current directory or in csh: (you will be able to modify
  242.       this) and you enter 'man <command>'
  243.     - The wild card #? doesn't work. Use *
  244.        (#? only works if you "escape" it... better use * :-)
  245.  
  246.  
  247. III. RESTRICTIONS
  248. -----------------
  249.  
  250. The c:Execute command cannot be redirected, does not return error codes, and
  251. might cause other problems. It will not work at all if it has been renamed.
  252.  
  253. The  VDK: handler and Frank Seidel's BootRam-Handler have a bug with setting
  254. file  dates,  so  when  using  the copy command you should try the -d and -p
  255. switches, otherwise your file date will be bad. (This is not a shell bug)
  256.  
  257. If  using  it with conman you may consider starting shell with the -a switch
  258. to  turn  off  shell's  command line editing and use conmans instead. You'll
  259. lose, however, many shell features like file name completion.
  260.  
  261. CB-handler  (a tool that installs a scrollbar in the CLI window) is not 100%
  262. compatible  with  cshell.  The log will not always represent the real screen
  263. contents.
  264.  
  265. Don't  use  the  "Iconify" feature of KingCON (a CON-Handler replacement that
  266. gives  you  scrollbar  and  other  features in CLI windows). Don't ignore the
  267. warning,  KingCON  gives you when iconifying a Cshell window. This will crash
  268. your  system  because Iconify makes Cshell's internal window pointer invalid.
  269. Start Cshell with option "-a" or "-t" to use "Iconify" safely.
  270.  
  271.  
  272. IV. NOTES ON PIPES
  273. ------------------
  274.  
  275.     PIPES
  276.     PIPES  have  been implemented using temporary T:  files.  Thus, you
  277.     should be  careful  when  specifying  a 't:*' expansion as it might
  278.     include the temporary files. These files are deleted on completion
  279.     of the pipe segment.
  280.  
  281.     The file names used are completely unique, even with multiple shell
  282.     running simultaneously.
  283.  
  284.     My  favorite  new  feature is the fact that you can now redirect to
  285.     and  from,  and pipe internal commands.  'echo charlie >ram:x', for
  286.     instance.  Another favorite:
  287.  
  288.     echo "echo mem | csh" | csh
  289.  
  290.     No BCPL program should be output-append redirected (>>).
  291.  
  292.  
  293. V.  COMMAND PRE-PROCESSOR
  294. -------------------------
  295.  
  296.     PREPROCESSING
  297.     Preprocessing is done on the command line before it is passed on to
  298.     an internal or external routine:
  299.  
  300.     ^c    where c is a character is converted to that control
  301.         character. Thus, say '^l' for control-l.
  302.  
  303.     \233    insert character code 233 octal. Do not use values between
  304.         200o and 232o, as they have special meanings. \240 is the
  305.         word separator.
  306.  
  307.     $name    where name is a variable name. Variable names can consist
  308.         of 0-9, a-z, A-Z, and underscore (_).  The contents of the
  309.         specified variable is used.  If the shell variable doesn't
  310.         exist, csh tries to find a local or global (ENV:) variable
  311.         of the same name. If that fails, too, "$name" is inserted.
  312.         That is, if the variable 'i' contains 'charlie',
  313.         then '$i' -> 'charlie'.
  314.         If the variable 'i' doesn't exist, then '$i' -> '$i'.
  315.  
  316.     ;    delimits commands.   echo charlie ; echo ben.
  317.  
  318.     ' '    (a space). Spaces delimit arguments.
  319.  
  320.     "string" a quoted string. Trailing quotes are optional.
  321.         For instance, if you want to echo five spaces and an 'a':
  322.  
  323.         echo      a       -> a
  324.         echo "    a"      ->      a
  325.  
  326.         See also builtin variable "_cquote".
  327.  
  328.     \c    override the meaning of special characters.
  329.         '\^a' is a circumflex and an a rather than control-a.
  330.         To get a backslash, you must say '\\'.
  331.  
  332.         also used to overide alias searching for commands.
  333.  
  334.     >file    specify output redirection.  All output from the command is
  335.         placed in the specified file.
  336.  
  337.     >>file    specify append redirection
  338.         (Does not work with BCPL programs).
  339.  
  340.     <file    specify input redirection. The command takes input from the
  341.         file rather than the keyboard (note: not all commands
  342.         require input; it makes no sense to say 'echo <charlie'
  343.         since the 'echo' command only outputs its arguments).
  344.  
  345.     <>file    specify input AND output redirection. The file must be
  346.         either "NIL:" or an interactive stream (eg, a console
  347.         window: <>CON:////InOut).
  348.  
  349.     |    PIPE specifier.  The output from the command on the left
  350.         becomes the input to the command on the right.  The current
  351.         SHELL implementation uses temporary files to store the data.
  352.  
  353.     !!    execute the previously executed command.
  354.     !nn    (nn is a number).  Insert the history command numbered n
  355.         (see the HISTORY command)
  356.     !partial search backwards through the history list for a command
  357.         which looks the same as 'partial', and execute it.
  358.  
  359.     #    enter comment.  The rest of the line is discarded.
  360.         (note: \# will, of course, overide the comment character's
  361.                special meaning)
  362.  
  363.     {e hi;e ho} executes two commands as one, so they can be redirected
  364.         together (see ALIAS command). The trailing curly brace is
  365.         optional.
  366.  
  367.     $(foo)    insert the stdout of the command 'foo' at this position of
  368.         the command line. Every line of the output will count as one
  369.         argument. The closing parenthesis is optional.
  370.  
  371.     `foo`    insert the stdout of the command 'foo' at this position of
  372.         the command line. Every blank separated word will count as
  373.         one argument. Leading, trailing and multiple blanks will be
  374.         removed. The trailing backtick is optional.
  375.  
  376.     $nn    (nn is a number).  Cshell scripts only!
  377.         Insert argument number nn for $nn.  Thus, $1 becomes the
  378.         first argument, $2 the second, $3 the third and so on.
  379.         $0 is the name of the command (script).  If there's no
  380.         argument nn then $nn remains unchanged (unset variable).
  381.  
  382.     $#    Number of arguments.  Cshell scripts only!
  383.         For example: if $# is 3 then $3 will be the highest
  384.         meaningful variable for an argument.
  385.  
  386.     --    stop option parsing here. Works for internal commands only.
  387.         Example: rm -- -x will remove the file '-x'
  388.  
  389.     Please note the subtle differences between
  390.         alias count {echo one;echo two}
  391.         alias count "echo one;echo two
  392.     The first form will create an alias that contains a local alias. The
  393.     other will create a plain alias. Also, things within braces will not
  394.     be parsed more than once, therefore a backslash needs not be pre-
  395.     ceded by a pair of backslashes. Thus the commands look the same as
  396.     if they were to be typed in at the prompt. To echo lots of '#',
  397.     either use:
  398.         forever {echo \#
  399.         forever "echo \\\#
  400.     A block can spread over several lines. Refer to the SOURCE command.
  401.  
  402.  
  403. VI. COMMAND LINE EDITING
  404. ------------------------
  405.  
  406.     o The command line can be up to 255 chars.
  407.     o Inserts  and  deletes  are handled correctly over multiple lines.
  408.     o The script 'menu.sh' installs an intuition menu that contains most
  409.       editing functions
  410.  
  411.     EDITING
  412.  
  413.     -- MOVING --
  414.     Left Arrow      One character left
  415.     Right Arrow      One character right
  416.     Shift-Left Arrow  One word left
  417.     Shift-Right Arrow One word right
  418.     ESC-Left Arrow      Beginning of line (^A) (^Z)
  419.     ESC-Right Arrow      End of line       (^E)
  420.     -- DELETING --
  421.     Backspace      Previous character
  422.     Del          Character under cursor
  423.     ESC-Backspace      Previous word     (^W)
  424.     ESC-Del          Next word
  425.     ESC-x-Backspace      To start of line  (^B)
  426.     ESC-x-Del      To end of line    (^K)
  427.     ESC-d          Entire line       (^X)
  428.     -- HISTORY --
  429.     Up Arrow      Recall previous commands
  430.     Down Arrow      Recall commands
  431.     Shift-Up Arow      Get history from partial (or number)
  432.     Shift-Down Arrow  Go below last command of history
  433.     ESC-Up Arrow      Get start of history
  434.     ESC-Down Arrow      Get end of history
  435.     ESC-!          Get history from partial (or number)
  436.     ^T          Insert tail (all but first word) of previous line
  437.     ^P          Duplicate previous word (useful for mv)
  438.     -- COMPLETION --
  439.     TAB          Inserts first matching file name
  440.     Shift-TAB      Inserts longest common substring
  441.     ESC-TAB          Inserts all matching file names (also ESC-*)
  442.     ESC-c          Does a quick cd on left word (TAB for cycling)
  443.     ESC-~          Inserts the last current directory
  444.     ^D          Shows all files that match a pattern (also ESC-=)
  445.     ESC-p          Insert first/next matching program name
  446.     ESC-P          Shows all matching program names
  447.     -- EXECUTING LINE --
  448.     Return          Executes line
  449.     ESC-Return      Executes this line of history & brings up next one
  450.     ^N          Next line. Don't exec this one but store history
  451.     ^\          EOF (directly exits)
  452.     -- MISCELLANEOUS --
  453.     ^L          Retype current line.
  454.     ^O          Echo a ^O
  455.     ^R          Repeat last command (don't play with this)
  456.     ^U          Undo/Redo last edit
  457.     ^V          Quote next char
  458.     ESC-i          Toggle Insert/Overwrite
  459.     f1-f10          Execute command if variable exists.
  460.     F1-F10          More commands (Shifted f keys).
  461.     Help          Invokes help command
  462.  
  463. Whenever  the  cursor is placed on or directly after an incomplete file name
  464. and   you   press  TAB,  CShell  inserts  for  the  first  filename  (sorted
  465. alphabetically) that matches the name part already typed.  Any wildcards are
  466. allowed  here, if none are given, '*' is appended.  Immediately pressing TAB
  467. again  brings  up  the next file name that matched the substring.  Shift-TAB
  468. will  only  insert  the  as much as is common to all files that matched your
  469. abbreviation.  If pressed again, behaves just like TAB.  ESC-Tab inserts the
  470. name  of the directory where you would have ended up with a quick cd to that
  471. substring.
  472.  
  473. Note that ^D now means 'quit batchfile' like under AmigaDOS and is no longer
  474. used for quitting CShell.  If you want it back, enter 'keymap 0 4=41'
  475.  
  476. The  CTRL  keys  FGVY  are unset, feel free to map them to any function (see
  477. chapter XV).  You can also remap all preset keys.
  478.  
  479. VII. FUNCTION KEYS
  480. ------------------
  481.  
  482.     FUNKEY
  483.     Function keys now insert text to the current position on the command
  484.     line. They may be terminated with a ^M (return). f1 would be non-
  485.     shifted where as F1 is shifted.
  486.     Most of functions key have a default definition, but it may be
  487.     changed.
  488.  
  489.         $ set f1 dir df0:^M
  490.  
  491.     will add the text 'dir df0:<return>' to the current line.
  492.  
  493.         $ set f1 dir
  494.  
  495.     would only add 'dir' you could then enter ' df0:<return>'
  496.  
  497.  
  498. VIII. SHELL COMMANDS
  499. --------------------
  500.  
  501.     STARTUP OPTIONS
  502.     First to start shell from a CLI:
  503.  
  504.     csh [-abcCfiknstv] [-c command;command]
  505.     csh [-abcCfiknstv] [batchfile1 ... batchfileN]
  506.  
  507.      -a  AUX: mode. No command line editing and text highlighting
  508.           (window opening is not forced and AUTO-windows don't lose
  509.            the ability to be closed)
  510.      -b  starts shell in background, which means only task priority -1.
  511.      -c  allows execution of one command line and then exits out
  512.          of  shell.   This  is  useful for running an internal shell
  513.          commands in the background or from an external application:
  514.         run csh -c "dir df0:; copy -r df0: df1: >nil:; echo Done"
  515.      -C  same as -c, but the command line is not parsed twice. This
  516.          allows passing of file names with blanks within.
  517.         run csh -C rm "Ram Disk:tempfile"
  518.      -f  starts shell in foreground, which means only task priority 1.
  519.          you might reset this prioritiy to 0 at the end of your .login
  520.      -k  sets _nobreak before doing anything
  521.      -L  suppresses starting of s:.logout
  522.      -m  sets _nomatch  (which is unset by default)
  523.      -M  don't clear menus (especially for KingCON),
  524.          by default CSH clears menus of its window
  525.      -n  suppresses starting of s:.login
  526.      -N  suppresses starting of s:.cshrc
  527.      -s  globally enables the asterisk * as alias for #? in AmigaDOS 2.0
  528.          This means you can use * inside file requesters as well.
  529.          (obsolete option -- * is default -- #? is still allowed !!)
  530.      -t  terminal mode. You can use command line editing and text high-
  531.          lighting on a VT100 compatible terminal. To swap backspace
  532.          and DEL, refer to the 'keymap' command
  533.           (window opening is not forced and AUTO-windows don't lose
  534.            the ability to be closed)
  535.      -v  sets _verbose to 'hs' before doing anything.
  536.      -V  send only VT100 compatible control sequences
  537.           (no special Amiga control sequences)
  538.      -w  don't fetch pointer of window Cshell is running in,
  539.           eg, for running Cshell remote or with KingCON (iconify)
  540.           (menus, titlebar and some window related commands disabled)
  541.  
  542.     COMMAND EXECUTION
  543.  
  544.     Internal shell commands are case sensitive and may be abbreviated.
  545.     Also commands buffered with "rehash" may be abbreviated. This can
  546.     be toggled with the variable "_abbrev".
  547.  
  548.     The first argument is the command-name... here is (in order) how
  549.     Shell tries to execute it:
  550.  
  551.     1)  The alias list is searched for an alias with an exactly
  552.         matching name.
  553.     2)  Internal commands list is scanned for a command even partially
  554.         matching name (so you can, for instance, say resi for resident;
  555.         however, you should specify enough of a command to be unique).
  556.     3)  Then, the list of functions is scanned for a command that
  557.         matches completely. If one is found, the result of the function
  558.         is echoed to stdout.
  559.     4)  Now the command is assumed to be external.
  560.         Arguments with blanks, semicolons or empty strings will be
  561.         surrounded by quotes.
  562.     5)  If the file is a directory, a 'cd <file>' will be performed to
  563.         it.
  564.     6)  AmigaDOS resident list are scanned for it (you can use Shell's
  565.         'resident' command to add/remove a file in the DOS list).
  566.     7)  If the file is in the current directory and it's executable, it
  567.         is started.
  568.     8)  Then it is searched in the AmigaDOS path and c:
  569.     9)  Now, the shell path ($_path) is searched. If it's found and
  570.         executable, it's started. If it has the 's' bit set, it will
  571.         be executed using the appropriate shell. See FOREIGN SHELLS
  572.     10) If there exists a file with the suffix '.sh' and the same root
  573.         in the current directory or in the shell path, it is 'source'd.
  574.     11) Then the variable _rxpath is examined. If there exists a file
  575.         with the suffix '.rexx' and the same root in the current direc-
  576.         tory or in '$_rxpath', 'RX <file>' will be performed.
  577.     12) If all failed, an 'exec' action is sent to the file. See chapter
  578.         XIV for more info on classes and actions.
  579.  
  580.     To enforce that the external 'dir'-command is used, enter 'Dir'. It
  581.     is a good habit to uppercase the first letter of all external com-
  582.     mands, even if this is not necessary.
  583.  
  584.     AUTOMATIC SOURCING may be accomplished by naming shell scripts with
  585.     a .sh suffix.  Thus, if you say 'stuff' and the file 'stuff.sh'
  586.     exists in your current or anywhere in Shell search path (NOTE:
  587.     won't be found in the AmigaDOS path), it will be SOURCED with all
  588.     arguments you have given placed in the $_passed variable.  This is
  589.     equivalent to typing 'source stuff.sh'
  590.  
  591.     FOREIGN SHELLS are supported through key characters at the beginning
  592.     of their scripts.  If a file in the command search path has the s-bit
  593.     set, the first few bytes are read. If the first two are either '#!'
  594.     or ';!', the rest of the first line will be interpreted as the name
  595.     of the shell that is supposed to execute the script.
  596.     If they are '/*', the command 'RX' is used, if none of the above,
  597.     'c:Execute'. Example:
  598.       #!SKsh -c source
  599.  
  600.     WILDCARDS
  601.  
  602.     Most shell commands will accept multiple arguments that can
  603.     be as a result of wild card expansion.  Also when calling
  604.     an external command shell will first expand any wild cards
  605.     to separate arguments.  If you wish to have the external command
  606.     handle it's own wild carding you will need to insert quotes
  607.     around the special wild card characters or use an alias (see
  608.     explanation of 'alias')
  609.  
  610.     eg.
  611.         arc a new.arc *.txt    - shell will expand and pass to arc
  612.         arc a new.arc "*.txt"    - let arc expand the wild cards.
  613.         alias arc "*a Arc $a"    - now shell will never expand
  614.  
  615.     The patterns are fairly extensive, and approximate some of the
  616.     ability of Unix/grep "regular expression" patterns.  Here are the
  617.     available tokens:
  618.  
  619.     ?    Matches a single character.
  620.     #    Matches the following expression 0 or more times.
  621.     (ab|cd)    Matches any one of the items seperated by '|'.
  622.     ~    Negates the following expression.  It matches all strings
  623.         that do not match the expression (aka ~(foo) matches all
  624.         strings that are not exactly "foo").
  625.     [abc]    Character class: matches any of the characters in the class.
  626.     [~bc]    Character class: matches any of the characters not in the
  627.         class.
  628.     a-z    Character range (only within character classes).
  629.     %    Matches 0 characters always (useful in "(foo|bar|%)").
  630.     *    Synonym for "#?", not available by default in 2.0. Available
  631.         as an option that can be turned on.
  632.  
  633.     "Expression" in the above table means either a single character
  634.     (ex: "#?"), or an alternation (ex: "#(ab|cd|ef)"), or a character
  635.     class (ex: "#[a-zA-Z]").
  636.  
  637.     Additional wildcards allowed:
  638.  
  639.     .../*    recursive search down ALL sub directories from current level
  640.     !    synonym for ~, supported for compatibility
  641.     &    prefixed to patterns, ask confirmation for each file
  642.     ~    the previous current directory (if separated)
  643.     Note that a pattern must contain a '?' or a '*', otherwise the other
  644.     special characters are not recognized. Furthermore, you cannot spe-
  645.     cify a single '?' as a pattern in the first argument to a command,
  646.     as this will be passed on to the command in order to show its usage.
  647.  
  648.     If pattern.library is present it LIBS:, it will be used for the
  649.     matching. (disabled, now Cshell always uses dos.library)
  650.  
  651.     Examples:
  652.  
  653.     df0:.../*    all files in all directories on df0:
  654.     df0:.../!*.info    full directory tree of df0: but exclude
  655.             any ugly .info files.
  656.     !*.o !*.c    will result in ALL files matching since what
  657.             doesn't match the !*.o will match the !*.c
  658.     df1:&*        all files in root of df1:, but ask
  659.             confirmation for each
  660.     *.[co]        all files ending in .c or .o
  661.     ~*.[co]        all files NOT ending in .c nor in .o
  662.     ~        the previous current directory
  663.     ~/*.c        all .c files in the previous current directory
  664.     ~//        the parent of the previous current directory
  665.     .        the current directory
  666.     ./foo.c        the same as foo.c
  667.     ..        the parent of the current directory
  668.     ../foo.c    the file foo.c in the parent directory
  669.  
  670.     Note that some commands prevent wild card expansion. These are:
  671.       - dir, rpn, whereis, window
  672.     Those commands will expand the wild cards themselves. This is why
  673.       dir @without( *.? , *.o )
  674.     will not work. Instead use:
  675.       set arg @without( *.? , *.o );dir $arg
  676.  
  677.     There is one exception to the rules given above: A single '?' as
  678.     the first argument will *not* expand in order to allow you to get
  679.     the usage of CLI and csh commands easily.
  680.  
  681.     Due to implementation limitations, patterns are only recognized
  682.     if they contain *, ?, [ or ]. To let Cshell expand patterns which
  683.     does not contain one of these chars just append "[]" to the
  684.     pattern (this will NOT change the meaning of the pattern!)
  685.  
  686.     ENVIRONMENT VARIABLES
  687.  
  688.     Cshell uses an Amiga specific CSI sequence to get the current
  689.     window dimensions (columns and lines).  If you've connected
  690.     Cshell to a remote terminal which is not an Amiga, you can change
  691.     the default window dimensions (80x25) with the environment
  692.     variables "COLUMNS" and "LINES".
  693.  
  694.     This is also useful if Cshell is not connected to a terminal
  695.     (eg, redirection to a file) and cannot determine window size
  696.     automatically.
  697.  
  698. LIST OF COMMANDS:
  699. -----------------
  700.  
  701.     ABORTLINE
  702.  
  703.     Usage    : abortline
  704.     Example    : echo a;abort;echo b
  705.     Results    : a
  706.  
  707.     Causes the rest of the line to be aborted. Intended for use in
  708.     conjunction with exception handling.
  709.  
  710.     ACTION
  711.  
  712.     Usage    : action [-a] actionname file [arguments]
  713.     Example : action extr csh515.lzh csh.doc
  714.  
  715.     Sends an action to a file. See chapter XIV CLASSES
  716.  
  717.     Options    :
  718.      -a (abort) returns 0 if failed and 1 if successful. Otherwise,
  719.                 normal error codes (10 or 11) are returned
  720.  
  721.     ADDBUFFERS
  722.  
  723.     Usage    : addbuffers drive
  724.           addbuffers drive buffers [drive buffers ...]
  725.     Example    : addbuffers df0: 24
  726.  
  727.     Just like AmigaDOS addbuffers command, causes new buffers to be
  728.     allocated for disk I/O.  Each buffer costs 512 bytes of memory,
  729.     CHIP memory if a disk drive. Buffers may be negative (to remove
  730.     buffers from a drive).
  731.  
  732.     To show actual amount of buffers use "addbuffers drive"
  733.     or "addbuffers drive 0".
  734.  
  735.     ADDPART (or TACKON)
  736.  
  737.     Equivalent to TACKON.
  738.  
  739.     ALIAS
  740.  
  741.     Usage    : alias [name [command string] ]
  742.     Example    : alias vt "echo Starting VT100;run sys:tools/vt100"
  743.  
  744.     Sets a name to be a string. You can alias a single name to a set
  745.     of commands if you enclose them in quotes as above. By simply
  746.     typing vt, the command line above would be executed.
  747.  
  748.     Aliases may call each other, but direct recursion is prohibited,
  749.     so the following works: alias ls "ls -s"
  750.     To prevent alias replacement, enter: \ls
  751.  
  752.     If you run aliases into background, they will be recursively
  753.     resolved. This may result in endless loops, if the name of the
  754.     alias and the command it runs are equal. Use absolute pathes or
  755.     mix the case of the command to avoid recursion.
  756.  
  757.     By typing "alias name", you will get the alias for that name, while
  758.     with "alias" you get a list of all alias.
  759.  
  760.     ARGUMENT PASSING TO AN ALIAS:
  761.  
  762.     Usage    : alias name "%var[%var...] [ command_string ]"
  763.           alias name "*var[%var...] [ command_string ]"
  764.     Example    : alias xx "%q%w echo hi $q, you look $w
  765.           xx Steve great today
  766.     Results    : hi Steve, you look great today
  767.  
  768.     The second form of the alias command allows passing of arguments
  769.     to any position within the command string via use of a variable
  770.     name. To pass arguments to the end of a command string this method
  771.     is actually not necessary. These variables are local, so they don't
  772.     destroy another variable with the same name.
  773.     If you specify multiple arguments, every argument will be assigned
  774.     one word, and the last argument will be assigned the rest of the
  775.     command line.
  776.  
  777.     Using a '*' instead of the first '%' prevents wild card expansion:
  778.         alias zoo "*a zoo $a
  779.     To expand the wild cards after you got them, use
  780.         exec set a $a
  781.  
  782.     IMPLICIT ALIASES:
  783.  
  784.     Usage    : {command;command}
  785.           {%var command;command} arg arg
  786.     Example    : {%tmp echo $tmp $tmp} hello    --> hello hello
  787.  
  788.     Curly braces define temporary aliases. They can be redirected as
  789.     a whole, can have arguments and local variables. They count as
  790.     one argument, even if there are blanks inside (as with quotes), and
  791.     they may be nested. Complex alias definitions can use the braces
  792.     instead of quotes, although this will add some calling overhead.
  793.     The closing curly brace is optional if at the end of line.
  794.     Example:
  795.  
  796.     alias assert {e "Are you sure? ";input -s sure
  797.  
  798.     ASCII
  799.  
  800.     Usage    : ascii [-ho]
  801.           ascii [-ho] string
  802.  
  803.     If called without arguments, ascii outputs a complete ASCII table.
  804.     Given a string, shows each character in ASCII.
  805.  
  806.     Options    :
  807.      -h shows numbers in hexadecimal
  808.      -o shows numbers in octal
  809.  
  810.     ASSIGN
  811.  
  812.     Usage    : assign
  813.           assign logical
  814.           assign [-adlnp] logical1 physical1 [log2 phy2 ... ]
  815.  
  816.     The first form shows all assigns.
  817.     The second form kills one assign.
  818.     The third form assigns logical1 to physical1 and so on.
  819.  
  820.     Options    :
  821.      -a adds a new path to an existing assign
  822.      -d creates a deferred (late-binding) assign
  823.          (identical with old option -l)
  824.      -p creates a path (non-binding) assign
  825.          (identical with old option -n)
  826.  
  827.     For definition of add/defer/path, refer to your AmigaDOS manual.
  828.  
  829.     BASENAME
  830.  
  831.     Usage    : basename var path [path ...]
  832.     Example    : basename x df0:c/Dir    # sets x to "Dir"
  833.  
  834.     Sets var specified to basenames of paths.
  835.  
  836.     CAT (or TYPE)
  837.  
  838.     Usage    : cat [-n] [file file....]
  839.     Example    : cat foo.txt
  840.  
  841.     Type the specified files onto the screen.  If no file is specified,
  842.     STDIN in used (note: ^\ is EOF).  CAT is meant to output text files
  843.     only.
  844.  
  845.     Options    :
  846.       -n  output numbered lines.
  847.  
  848.     CD
  849.  
  850.     Usage    : cd [path]
  851.           cd -g device1 [device2 [device3 ...]]
  852.  
  853.  
  854.     Options    :
  855.      -g generate a list of all directories on the given devices.
  856.  
  857.     Change your current working directory.  You may specify '..' to go
  858.     back one directory (this is a CD specific feature, and does not
  859.     work with normal path specifications).
  860.  
  861.     In most cases, you won't have to use the CD command. Just type
  862.     the desired directory at the prompt (very handy in conjunction with
  863.     file name completion). Typing a ~ alone on a command line cd's
  864.     to previous current directory.
  865.  
  866.     There are two situations left when you still need it:
  867.  
  868.     Entering 'cd *tem' will cd to the first name matched.
  869.  
  870.     The second form generates a list (an ASCII file) of all direc-
  871.     tories on the given devices. It will be stored in the file given
  872.     in $_qcd (default: 'csh:csh-qcd'). Note that this ASCII file will
  873.     not be merged but overwritten. Once you have generated this file,
  874.     you can cd to any directory on your harddisk(s) even if it's not
  875.     in the current directory.
  876.     If you have two directories of the same name and you use one of
  877.     them more, move the more important one to the beginning of the
  878.     qcd file. You might also sort the file.
  879.     It is legal to type just an abbreviation of the directory name
  880.     you want to cd to. No asterisk '*' necessary. If you end up in
  881.     the wrong directory, cd to the same directory again (best done
  882.     by Cursor-Up + RETURN). You will cycle through all directories
  883.     that matched the given abbreviation. The other possibility is to
  884.     specify the full name of the parent directory: cd devs/keym
  885.     You may also add devices and assigns, so if 'PageStream:' is one
  886.     line in the qcd-file, a cd to 'page' is successful.
  887.  
  888.     CD without any arguments displays the path of the directory you
  889.     are currently in.
  890.  
  891.     CHGRP
  892.  
  893.     Usage    : chgrp group file1 ... filen
  894.     Example    : chgrp 42 myfile
  895.  
  896.     Set group-id (0-65535) or group-name of specified files.
  897.     Name-to-ID mapping does only work with "MultiUser".
  898.  
  899.     CHMOD
  900.  
  901.     Usage    : chmod [u|g|o|a][+|-|=][flags] file1 ... filen
  902.     Example    : chmod u+rwe myfile
  903.  
  904.     Set AmigaDOS file protection flags for the file specified.
  905.     Valid flags are h, s, p, a, r, w, e, d.  (x is the same as e)
  906.  
  907.     Ownership:
  908.       u  Set specified bits for User (aka Owner)
  909.       g  Set specified bits for Group
  910.       o  Set specified bits for Other (not User, not Group)
  911.       a  all, alias for "ugo" (User/Group/Other)
  912.     Specifying no ownership is equal to 'u'.
  913.  
  914.     Modes:
  915.       +  Set specified bits, leave all others
  916.       -  Clear specified bits, leave all others
  917.       =  Set specified bits, clear all others
  918.     Specifying no mode is equal to '='.
  919.  
  920.     Archive bit cleared by default!
  921.  
  922.     Note: This command is equivalent to "protect" except that the
  923.           arguments for filename(s) and flag(s) are reversed.
  924.  
  925.     CHOWN
  926.  
  927.     Usage    : chown [-g] owner file1 ... filen
  928.     Example    : chown 42 myfile
  929.  
  930.     Options    :
  931.      -g set GID of the file to primary group of user (needs MultiUser)
  932.  
  933.     Set owner-id (0-65535) or owner-name of specified files.
  934.     Name-to-ID mapping does only work with "MultiUser".
  935.  
  936.     CLASS
  937.  
  938.     Usage    : [-n] name {type=param} [ "actions" {action=command} ]
  939.     Example : class zoo offs=20,dca7c4fd ext=.zoo actions view="zoo l"
  940.  
  941.     Defines a new class of files and the actions to be taken on them
  942.     in various cases, or shows old definitions if given no arguments.
  943.     See section XIV: OBJECTS
  944.  
  945.     Options    :
  946.       -n (new)  forgets old definitions
  947.  
  948.  
  949.     CLOSE
  950.  
  951.     Usage    : close [filenumber]
  952.  
  953.     Close the specified file opened by open. Without filenumber, closes
  954.     all open files. See open and flist for more info.
  955.  
  956.     CLS
  957.  
  958.     Usage    : cls
  959.  
  960.     This is an alias. It only clears the screen, but also works on a
  961.     terminal (echo ^L doesn't).
  962.  
  963.     COPY (or CP)
  964.  
  965.     Usage    : copy [-udfpmoax]  file file
  966.     or    : copy [-udfpmoax]  file1 file2...fileN dir
  967.     or    : copy [-rudfpoax] dir1...dirN file1...fileN dir
  968.  
  969.     Options    :
  970.      -r recursive, copy all subdirectories as well.
  971.      -u update, if newer version exists on dest, don't copy
  972.      -f freshen, if file doesn't exist on dest or newer, don't copy
  973.      -q suppresses 'not newer' and 'not there' messages in -u and -f
  974.      -d don't set destination file date to that of source.
  975.      -p don't set destination protection bits to those of source.
  976.      -m erases the original. does not work with -r
  977.      -o overwrites write/delete-protected, reads read-protected
  978.      -a don't clear archive bit
  979.      -x alternative output format, shows full path of files being copied
  980.  
  981.     Example    : copy -r df0: df1:
  982.  
  983.     Copy files or directories. When copying directories, the -r option
  984.     must be specified to copy subdirectories as well.  Otherwise, only
  985.     top level files in the source directory are copied.
  986.  
  987.     All files will be displayed as they are copied and directory's
  988.     displayed as they are created. This output can be suppressed by
  989.     redirecting to nil: eg. copy -r >nil: df0: df1:
  990.  
  991.     Copy will abort after current file on Control-C.
  992.  
  993.     Copy by default sets the date of the destination file to that of
  994.     the source file. To overide this feature use the -d switch.
  995.  
  996.     Similarly, it sets protection bits (flags) to those of source and
  997.     any file comment will be copied. To avoid this use -p. The archive
  998.     bit is always cleared by default (use option -a to leave it
  999.     untouched).
  1000.  
  1001.     Another useful option is the -u (update) mode where copy will not
  1002.     copy any files which exists already in the destination directory
  1003.     if the destination file is newer or equal to the source file.
  1004.     This is useful when developing code say in ram: eg. 'copy *.c ram:'
  1005.     when done you can copy -u ram: df1: and only those modules you have
  1006.     modified will be copied back.
  1007.  
  1008.     Copy command will now create the destination directory if it does
  1009.     not exist when specified as 'copy [-r] dir dir'. If you specify
  1010.     copy file file file dir, then 'dir' must already exist.
  1011.  
  1012.     CP (or COPY)
  1013.  
  1014.     Equivalent to COPY.
  1015.  
  1016.     DATE
  1017.  
  1018.     Usage    : date [-bsr] [new date and/or time]
  1019.     Example    : date Wednesday  # this refers to NEXT wed, of course
  1020.  
  1021.     Options    :
  1022.       -b print date/time from the battery clock, if existent
  1023.       -s stores the current time internally
  1024.       -r shows time relative to last stored in secs and hundredths
  1025.  
  1026.     Used to read or set system date and/or time. All standard options
  1027.     may be used (yesterday, tomorrow, monday, etc.).
  1028.     Leading zero's are not necessary.
  1029.     Without parameters shows Dddddd DD-MMM-YY HH:MM:SS.
  1030.  
  1031.     DEC
  1032.  
  1033.     Usage    : dec varname [value]
  1034.     Example    : dec abc
  1035.  
  1036.     Decrement the numerical equivalent of the variable with specified
  1037.     value (default: 1) and place the ASCII-string result back into
  1038.     that variable.
  1039.  
  1040.     DELETE (or RM)
  1041.  
  1042.     Usage    : delete [-fpqrv] file file file...
  1043.     Example    : delete foo.txt test.c
  1044.  
  1045.     Remove (delete) the specified files.  Remove always returns
  1046.     errorcode 0.  You can remove empty directories.
  1047.  
  1048.     Options    :
  1049.      -r recursively remove non-empty directories.
  1050.      -p (or f); remove delete-protected files.
  1051.      -v toggle verbose output.  Useful if 'delete' is aliased.
  1052.      -q (quit), delete aborts if the file to be removed didn't exist
  1053.          or couldn't be deleted. This does _not_ affect non-matching
  1054.          wildcards.
  1055.  
  1056.     If you specify any wildcard deletes the files will be listed as
  1057.     they are deleted. This can be suppressed by redirecting to nil:
  1058.  
  1059.     DIR (or LS)
  1060.  
  1061.     Usage    : dir [-abcdfhiklnoqstuv] [-z [lformat]] [path path ... ]
  1062.     Example    : dir -ts downloads:
  1063.           dir -lz "%7s %-.16n %m" *.c
  1064.     Options    :
  1065.      -d list directories only
  1066.      -f list files only
  1067.      -h list only files which not start with a dot, end with '.info' or
  1068.         have the h-flag set. Adds an 'i' bit to the flags which tells
  1069.         if an according .info file exists.
  1070.      -s short multi(4) column display.
  1071.      -c don't change colors for directories
  1072.      -q quiet display. does not show length in blocks
  1073.      -o display file nOtes
  1074.      -n display names only
  1075.      -p display full path names and suppress directory titles
  1076.      -a shows the age of all files in the format  days hours:minutes
  1077.      -i identifies every file, shows the type instead of the date.
  1078.         See chapter XIV CLASSES
  1079.      -v (viewdir) recursively sums up lengths of the files in a dir
  1080.      -l sorts the files by their length, longest first.
  1081.      -t sorts the files by their time, most recent first.
  1082.      -k sorts the files by their class (klass)
  1083.      -b sorts the files backwards.
  1084.      -g prints directories at the beGinning
  1085.      -e prints directories at the End
  1086.      -u must be given exactly two directories. Shows files only in
  1087.         the first directory, files in both and files in the second.
  1088.      -z custom format
  1089.         (must be followed by an argument which holds the format string)
  1090.  
  1091.     Displays a directory of specified files. Default output shows
  1092.     date, protection, block size, byte size and total space used.
  1093.     Protections flags include new 1.2/1.3 flags (see under protect),
  1094.     plus a 'c' flag which indicates that this file has a comment.
  1095.     Files are alphabetically sorted, without case sensitivity, and
  1096.     directories are in red pen (unless you use -c). Dir takes in
  1097.     account the width of your window.
  1098.  
  1099.     To recursively show the contents of a directory and all its
  1100.     sub-directories use the special wildcard pattern ".../*", see
  1101.     section "WILDCARDS" (man wildcards).
  1102.  
  1103.     The lformat string (option -z) is used to create your own directory
  1104.     format. Instead of the "-z lformat" command line argument you can
  1105.     set the variable "_dirformat" (which holds "lformat", but you must
  1106.     set option -z anyhow).
  1107.     Your custom format may contain the following codes:
  1108.      %a age               %l LF if comment      %t time
  1109.      %b size in blocks    %m multi column       %u size in K
  1110.      %c flag c (comment)  %n name               %v dir size in eng.
  1111.      %d date              %o filenote (comment) %w dir size in K
  1112.      %e flag i (.info)    %p name w/ path       %x translated date
  1113.      %f flags "hsparwed"  %q name w/ slash      %+ flag i as '+' or ' '
  1114.      %i flag d (dIr)      %r size in eng.
  1115.      %k class             %s size
  1116.  
  1117.      %I link information (S: softlink, H: hardlink, P: pipe, -: else)
  1118.      %L name of original file if link (empty otherwise)
  1119.      %N name + original name (of link)
  1120.      %F protection bits (flags "rwed") for group/other
  1121.      %U user-id
  1122.      %G group-id
  1123.  
  1124.     Between the '%' and the identifying letter, there may be an optional
  1125.     field width. If the number is preceded by a '-', the field contents
  1126.     will be left adjusted. If by a dot, the contents will be cut down
  1127.     to match the field width if they are longer.
  1128.     If the format string contains a %m, cshell will try to print more
  1129.     than one entry on one line. The column width is the field width of
  1130.     the %m entry. If omitted, it's assumed to be the one of the first
  1131.     file. If a file is longer, it will use two columns.
  1132.  
  1133.     If you prefer the old output-style of this command (5.19 and before)
  1134.     add the following line to your .cshrc file:
  1135.      set _dirformat "   %-24n %c%f %7s %4b %d %t"
  1136.  
  1137.     DISKCHANGE
  1138.  
  1139.     Usage    : diskchange drive...drive
  1140.  
  1141.     Like AmigaDOS diskchange.  Multiple drive names are allowed.
  1142.  
  1143.     ECHO
  1144.  
  1145.     Usage    : echo [-en] string
  1146.     Example    : echo hi there
  1147.     Results    : hi there
  1148.  
  1149.     Options    :
  1150.      -n don't append newline.
  1151.      -e echo to stderr.
  1152.  
  1153.     Echo the given string.
  1154.  
  1155.     ELSE
  1156.  
  1157.     Usage    : else ; command
  1158.     Usage    : if -f foo.c ; else ; echo "Not there" ; endif
  1159.  
  1160.     Else clause, must follow an IF statement.
  1161.  
  1162.     ENDIF
  1163.  
  1164.     Usage    : endif
  1165.  
  1166.     The end of an if statement.
  1167.  
  1168.     Note: if you return from a script file with unterminated IF's
  1169.     and the last IF was false, prompt will be changed to an
  1170.     underscore ('_') and no commands will be executed until
  1171.     'endif' is typed.
  1172.  
  1173.     ERROR
  1174.  
  1175.     Usage    : error n
  1176.  
  1177.     Generates return code n.
  1178.  
  1179.     EXEC
  1180.  
  1181.     Usage    : exec [-i] command [args]
  1182.     Example    : set cmdline "dir ram:"
  1183.           exec $cmdline        # would not work without exec
  1184.  
  1185.     Options    :
  1186.      -i  return code 0.
  1187.  
  1188.     Execute the command specified; exec command is equivalent to
  1189.     command, only you can use variables to specify command name.
  1190.     Note that the command line is parsed TWICE! Examples:
  1191.      set a dir ram:; exec $a              # right
  1192.      set a mkdir; exec $a "My directory"  # wrong! creates 2 directories
  1193.  
  1194.     Exec returns the return code of the command executed unless
  1195.     option -i (ignore) is set, in which case always 0 is returned.
  1196.  
  1197.     FAULT
  1198.  
  1199.     Usage    : fault error1 .. errorN
  1200.     Example    : fault 205 212
  1201.  
  1202.     Like AmigaDOS fault, prints specified error messages.
  1203.  
  1204.     FILENOTE
  1205.  
  1206.     Usage    : filenote file1 .. fileN  note
  1207.           filenote -s file1...fileN
  1208.  
  1209.     Options    :
  1210.      -s (second form) ; displays the file notes of the given files.
  1211.  
  1212.     The first form sets AmigaDOS comment of the specified file.
  1213.  
  1214.     FLIST
  1215.  
  1216.     Usage    : flist
  1217.  
  1218.     Lists the filenumbers of files opened by open.
  1219.     See open and close for more info.
  1220.  
  1221.     FLTLOWER
  1222.  
  1223.     Usage    : fltlower
  1224.     Example    : dir | fltlower
  1225.     Or    : fltlower <readme
  1226.  
  1227.     This is a filter command, i.e. it reads from stdin and writes to
  1228.     stdout. The more natural way to use it is a pipe, or it can be
  1229.     redirected.
  1230.     Its purpose is to convert all alphabetic to lower case.
  1231.  
  1232.     FLTUPPER
  1233.  
  1234.     The same of fltlower, only this converts to upper case.
  1235.  
  1236.     FOREACH
  1237.  
  1238.     Usage    : foreach [-v] varname ( strings ) command
  1239.     Example    : foreach i ( a b c d ) "echo -n $i;echo \" ha\""
  1240.     Result    : a ha
  1241.           b ha
  1242.           c ha
  1243.           d ha
  1244.  
  1245.     Options    :
  1246.      -v display arguments every time command is executed.
  1247.  
  1248.     'strings' is broken up into arguments.  Each argument is placed in
  1249.     the local variable 'varname' in turn and 'command' executed. Put
  1250.     the command(s) in quotes.
  1251.  
  1252.     Foreach is especially useful when interpreting passed arguments in
  1253.     an alias.
  1254.  
  1255.     eg.
  1256.         foreach i ( *.pic ) viewilbm $i
  1257.     assuming a.pic and b.pic in current directory the following commands
  1258.     will occur:
  1259.         viewilbm a.pic
  1260.         viewilbm b.pic
  1261.  
  1262.     All 'for...' commands can be interrupted using CTRL-D or CTRL-E.
  1263.  
  1264.     FOREVER
  1265.  
  1266.     Usage    : forever command
  1267.     or    : forever "command;command;command..."
  1268.  
  1269.     The specified commands are executed over and over again forever.
  1270.  
  1271.     Execution stops if you hit ^C or ^D, or if the commands return with
  1272.     an error code.
  1273.  
  1274.     FORLINE
  1275.  
  1276.     Usage    : forline var filename command
  1277.     or    : forline var filename "command;command..."
  1278.     Example    : forline i RAM:temp "echo line $_linenum=$i"
  1279.  
  1280.     For each ASCII line of file specified commands are executed and
  1281.     var points to line content. You can check system variable _linenum
  1282.     to find the number of the line currently read.
  1283.     If STDIN (case sensitive) is specified as input file, the lines are
  1284.     read from standard input.
  1285.  
  1286.     FORNUM
  1287.  
  1288.     Usage    : fornum [-v] var n1 n2 command
  1289.     or    : fornum [-v] -s var n1 n2 step command
  1290.  
  1291.     Example    : fornum -v x 1 10 echo $x
  1292.     or    : fornum -s x 10 1 -1 echo $x # counts backwards
  1293.  
  1294.     Executes  command(s)  for  all numerical values of x between n1 and
  1295.     n2.   If  more  than  one  command  is  specified,  or  command  is
  1296.     redirected, include command(s) in quotes.
  1297.  
  1298.  
  1299.     Options    :
  1300.      -v (verbose) causes printing of progressive numbers.
  1301.      -s specify a step; if negative, the count will be backwards.
  1302.  
  1303.     GETENV
  1304.  
  1305.     Usage    : getenv [shellvar] envvar
  1306.  
  1307.     Gets the value of an ENV: variable and stores it in the shell
  1308.     variable 'shellvar'. If shellvar is omitted, the value of the
  1309.     ENV: variable is printed to stdout.
  1310.     This command is obsolete since ENV: variables can be retrieved
  1311.     by writing $envvar anywhere on the command line.
  1312.  
  1313.     GOTO
  1314.  
  1315.     Usage    : goto label
  1316.     Example    :
  1317.           label start
  1318.             echo "At start"
  1319.             dir ram:
  1320.             goto start
  1321.  
  1322.     Goto  the specified label name.  You can only use this command from
  1323.     a  source  file.   Labels  may  be  forward or reverse from current
  1324.     position. It is legal to jump out of if's.
  1325.  
  1326.     HEAD
  1327.  
  1328.     Usage    : head [filename] [num]
  1329.     Example    : head readme 20
  1330.  
  1331.     Display first "num" lines of "filename".   If num is not specified,
  1332.     10 is assumed. If filename is not specified, standard input (stdin)
  1333.     is taken instead.
  1334.  
  1335.     HELP
  1336.  
  1337.     Usage    : help [-f]
  1338.     Example    : help
  1339.     Options    :
  1340.      -f list functions also
  1341.  
  1342.     Simply  displays  all  the  available  commands.   The commands are
  1343.     displayed in search-order.  That is, if you give a partial name the
  1344.     first  command  that  matches  that  name  in  this list is the one
  1345.     executed.   Generally,  you  should  specify enough of a command so
  1346.     that it is completely unique.
  1347.  
  1348.     HISTORY
  1349.  
  1350.     Usage    : history [-nr] [partial_string]
  1351.     Example    : history
  1352.  
  1353.     Options    :
  1354.      -n omits line numbering
  1355.      -r reads history from stdin
  1356.  
  1357.     Displays  the  enumerated  history  list.   The size of the list is
  1358.     controlled  by  the  _history  variable.   If you specify a partial
  1359.     string, only those entries matching that string are displayed.
  1360.  
  1361.     HOWMANY
  1362.  
  1363.     Usage    : howmany
  1364.  
  1365.     This  command  tells you how many instances of Shell are running in
  1366.     your system.
  1367.  
  1368.     HTYPE
  1369.  
  1370.     Usage    : htype [-r] [file1..fileN]
  1371.  
  1372.     Options    :
  1373.      -r display all files in a directory.
  1374.  
  1375.     Displays the specified files in hex and ASCII, just like the system
  1376.     command 'Type file opt h'.  Especially suitable for binary files.
  1377.  
  1378.     If there are no filenames specified, standard input is used,
  1379.     so you can use htype as the destination for a pipe.
  1380.  
  1381.     IF
  1382.  
  1383.     Usage    : if [-n] argument conditional argument [then]
  1384.     or    : if [-n] argument
  1385.     or    : if [-n] -f file    or   -e file
  1386.     or    : if [-n] -d file/dir
  1387.     or    : if [-n] -m
  1388.     or    : if [-n] -t file file1 .. fileN
  1389.     or    : if [-n] -r rpnexpression
  1390.     or    : if [-n] -v varname
  1391.     or    : if [-n] -o char arg ... arg
  1392.  
  1393.     Options    :
  1394.      -n (NOT) reverses the result.
  1395.      -d tests the type of the object specified: if it is a
  1396.         directory, then TRUE; if it is a file (or it doesn't exist)
  1397.         then FALSE.
  1398.      -f (or -e) checks for existance of the specified file.
  1399.      -m test if FAST memory is present.
  1400.      -o tests for option 'char' in the rest of the arguments.
  1401.      -r evaluates a given RPN expression (see under RPN for more info).
  1402.         If value on top of stack is 0, then FALSE, else TRUE.
  1403.      -t compare the date and time of the first file with all the others;
  1404.         if the first is younger than ALL the others, then FALSE,
  1405.         else TRUE. If a file doesn't exists, it is considered as
  1406.         being older.
  1407.      -v test if a given variable is defined.
  1408.  
  1409.  
  1410.     Makes the following instructions up to the next endif conditinal.
  1411.     The 'then' is optional. The if clause must be followed by a semi-
  1412.     colon if instructions follow on the same line.
  1413.  
  1414.     If a single argument is something to another argument.  Conditional
  1415.     clauses allowed:
  1416.  
  1417.     <, >, =, ! and combinations.  Thus != is not-equal, >= larger or
  1418.     equal, etc...
  1419.  
  1420.     If arguments are not numeric, they are compared as strings.
  1421.  
  1422.     Usually the argument is either a constant or a variable ($varname).
  1423.  
  1424.     The second form of IF is conditional on the existence of the
  1425.     argument.  If the argument is a "" string, then FALSE, else TRUE.
  1426.  
  1427.     The third form of IF used by -f switch checks for existance of
  1428.     the specified file. -e is the same as -f
  1429.  
  1430.     Option -m is used to test if FAST memory is present.
  1431.     Example (to be included in a login.sh file):
  1432.     if -m; resident -d lc1 lc2 blink; endif
  1433.  
  1434.     Using -t form compares the date and time of the first file with
  1435.     all the others; if the first is younger than ALL the others, then
  1436.     FALSE, else TRUE. If a file doesn't exists, it is considered as
  1437.     being older.
  1438.     This feature is especially useful for building makefiles without
  1439.     using any MAKE utility.
  1440.  
  1441.     Example:
  1442.     if -t test.o test.asm test.i ; asm -o test.o test.asm ; endif
  1443.  
  1444.  
  1445.     Option -o tests for option 'char' in the rest of the arguments.
  1446.  
  1447.     Example: if -o r -rp ram:comm1.c     will yield TRUE.
  1448.  
  1449.     When using 'IF' command interactively if you are entering commands
  1450.     following an 'IF' that was false, the prompt will be set to a
  1451.     underscore '_ ' to indicate all commands will be ignored until
  1452.     an 'ELSE' or 'ENDIF' command is seen.
  1453.  
  1454.     INC
  1455.  
  1456.     Usage    : inc varname [value]
  1457.     Example    : inc abc 5
  1458.  
  1459.     Increment the numerical equivalent of the variable with specified
  1460.     value (default: 1) and place the ASCII-string result back into
  1461.     that variable.
  1462.  
  1463.     INFO
  1464.  
  1465.     Usage    : info [-pt] [path1 path2 ... pathN]
  1466.  
  1467.     Options    :
  1468.      -p  only display drives with readable (present) disks
  1469.      -t  print disk/fs type and bytes used instead of block sizes
  1470.  
  1471.     If called without arguments, info gives you the drive information
  1472.     on all devices. If one or more paths are specified, only infor-
  1473.     mation on those drives will be displayed.
  1474.  
  1475.     Note: Cshell does (correct) rounding for all displayed values,
  1476.           Commodore's Info command does not. So values may slightly
  1477.           change.
  1478.  
  1479.     INPUT
  1480.  
  1481.     Usage    : input [-sr] var var ... var
  1482.     Example    : input abc
  1483.  
  1484.     Options    :
  1485.      -s the whole line is read in as one word, including spaces.
  1486.      -r puts the console to single character mode before reading,
  1487.         ie. does not wait for RETURN to be pressed). Use with care.
  1488.  
  1489.     Input from STDIN (or a redirection, or a pipe) to a variable.  The
  1490.     next input line is broken up in words (unless quoted) and placed in
  1491.     the variable.
  1492.  
  1493.     JOIN
  1494.  
  1495.     Usage    : join [-r] file1..fileN destfile
  1496.     Example    : join part1 part2 part3 total
  1497.  
  1498.  
  1499.     Options    :
  1500.      -r overwrite any existent destfile.
  1501.  
  1502.     Joins (concatenates) the specified files to get destfile. Join
  1503.     will refuse to overwrite an existing destfile, unless the
  1504.     'r' option is used.
  1505.  
  1506.     KEYMAP
  1507.  
  1508.     Usage    : keymap [number {key=function}]
  1509.     Example    : keymap 0 1030=4 1032=12
  1510.  
  1511.     Defines one keymap for the csh command line editing. See chapter XV.
  1512.  
  1513.     LABEL
  1514.  
  1515.     Usage    : label name
  1516.  
  1517.     Create a program label right here. Used in source files, you can
  1518.     then GOTO a label.
  1519.  
  1520.     LINECNT
  1521.  
  1522.     Another filter. Counts the number of lines of its stdin and writes
  1523.     it to stdout.
  1524.  
  1525.     LN (or MAKELINK)
  1526.  
  1527.     Usage    : ln [-s] filename [linkname]
  1528.     Example    : ln stuff/data newname
  1529.  
  1530.     Options    :
  1531.      -s make soft link (default is hard link)
  1532.  
  1533.     ln creates an additional directory entry, called a link,  to
  1534.     a file or directory.  Any number of links can be assigned to
  1535.     a file.
  1536.  
  1537.     filename is the name of  the  original  file  or  directory.
  1538.     linkname  is  the  new  name  to  associate with the file or
  1539.     filename.  If linkname is omitted,  the  last  component  of
  1540.     filename is used as the name of the link.
  1541.  
  1542.     A hard link (the default) is a standard directory entry just
  1543.     like the one made when the file was created.  Hard links can
  1544.     only be made to existing files.  Hard links cannot  be  made
  1545.     across file systems (disk partitions, mounted file systems).
  1546.     To remove a file, all hard links  to  it  must  be  removed,
  1547.     including  the  name by which it was first created; removing
  1548.     the last hard link releases the inode  associated  with  the
  1549.     file.
  1550.  
  1551.     A symbolic link, made with  the  -s  option,  is  a  special
  1552.     directory entry that points to another named file.  Symbolic
  1553.     links can span file systems and point  to  directories.   In
  1554.     fact,  you  can create a symbolic link that points to a file
  1555.     that is currently absent from the file system; removing  the
  1556.     file that it points to does not affect or alter the symbolic
  1557.     link itself.
  1558.  
  1559.     NOTE: Symbolic links (also known as "soft links") are
  1560.           currently NOT SUPPORTED by AmigaOS.  DO NOT USE!
  1561.  
  1562.     LOCAL
  1563.  
  1564.     Usage: local [var...var]
  1565.  
  1566.     Creates one or more local variables. Those variables disappear
  1567.     at the end of their alias or source file, and cannot be accessed
  1568.     from inside other aliases or source files.
  1569.     With no arguments, shows all top level variables and their values.
  1570.  
  1571.     LS (or DIR)
  1572.  
  1573.     Equivalent to DIR.
  1574.  
  1575.     MAKELINK (or LN)
  1576.  
  1577.     Equivalent to LN.
  1578.  
  1579.     MAN
  1580.  
  1581.     Usage    : man command(s)
  1582.     Example    : man mkdir
  1583.  
  1584.     Get  info about a Shell command, or others keywords.  These include
  1585.     all  special  _variables, plus various keywords:  WILDCARDS, PIPES,
  1586.     EDITING, STARTUP and more.
  1587.     See special alias manlist to get a list of ALL keywords supported
  1588.     by man.
  1589.     You  must set _man to the paths of your .doc files:
  1590.        set _man dh1:docs/aliases.doc dh1:docs/csh.doc
  1591.  
  1592.     To create your own .doc files, precede all your keywords by four
  1593.     blanks. 'man' will then display lines until the first character
  1594.     of a line is alphanumeric or has four leading blanks.
  1595.  
  1596.     MD (or MKDIR)
  1597.  
  1598.     Equivalent to MKDIR.
  1599.  
  1600.     MEM
  1601.  
  1602.     Usage    : mem [-cfqsl]
  1603.  
  1604.     Options    :
  1605.       -c shows the free chip mem only
  1606.       -f shows the free fast mem only
  1607.       -q outputs just a number without titles
  1608.       -s stores current free memory
  1609.       -r shows memory used relative to last stored
  1610.       -l flushes all unneeded memory
  1611.  
  1612.     MENU
  1613.  
  1614.     Usage    : menu [-mn] [ title item...item ]
  1615.     Example    : menu Shell   JrComm,,j   Rename,"rename ",r  quit
  1616.  
  1617.     Options    :
  1618.      -n clear all existing menus.
  1619.      -m use monospaced font.
  1620.  
  1621.     Appends one pull down in the current console window. Up to 31
  1622.     menus with 63 items each (including title) can be installed.
  1623.  
  1624.     If the item is just a string, that string will be in the menu item.
  1625.     When you select it, it will be put into the prompt and executed.
  1626.  
  1627.     If there is a comma and after that comma a second string, this
  1628.     will be the command will be inserted at the prompt. This time you
  1629.     have to add the ^M yourself if you want the command to be executed.
  1630.  
  1631.     If there is a second comma, the letter after that comma will be
  1632.     the keyboard shortcut for that menu item. (This will be case
  1633.     sensitive some day, use lowercase).
  1634.  
  1635.     If for any reason your current menu is corrupt, just enter an
  1636.     empty 'menu' command.
  1637.  
  1638.     When the first menu is installed you can use option -m to choose
  1639.     a monospaced font (System Default Font) instead of the default
  1640.     Intuition Font (which may be a proportional font). This is useful
  1641.     for user-formatted menus (like in the example script "menu.sh").
  1642.  
  1643.     MKDIR (or MD)
  1644.  
  1645.     Usage    : mkdir [-p] name name name...
  1646.     Example    : mkdir df0:stuff
  1647.  
  1648.     Options    :
  1649.      -p create all dirs in path if necessary.
  1650.  
  1651.     Create the specified directories.
  1652.     If "name" ends with trailing slash it will be stripped off.
  1653.  
  1654.     mkdir now supports the -p option.  mkdir -p followed by a full path
  1655.     name will create all directories necessary to make the path.  For
  1656.     example, suppose that the directory ram:foo exists and is empty.
  1657.     "mkdir -p ram:foo/bar/tst/a" would create ram:foo/bar,
  1658.     ram:foo/bar/tst, and ram:foo/bar/tst/a all in one step.
  1659.     In addition, it will issue no error codes for directories it cannot
  1660.     make.
  1661.  
  1662.     MV (or RENAME)
  1663.  
  1664.     Equivalent to RENAME.
  1665.  
  1666.     OPEN
  1667.  
  1668.     Usage    : open filename filemode filenumber
  1669.     Example    : open RAM:data w 1
  1670.  
  1671.     This  allows you to open a file, redirect to it as many commands as
  1672.     you like, then close it.
  1673.     Filename is any valid AmigaDOS filename, filemode is either "r" for
  1674.     read or "w" for write, filenumber is a number between 1 and 10.
  1675.     To  redirect  a  program to or from an open file, use as your redir
  1676.     filename a dot followed by the filenumber.
  1677.     Here is a complete example:
  1678.  
  1679.         open RAM:data w 1
  1680.         echo -n 2+2= >.1
  1681.         rpn 2 2 + . CR >.1
  1682.         close 1
  1683.         type RAM:data    # will display 2+2=4
  1684.  
  1685.     See also close, flist.
  1686.  
  1687.     PATH
  1688.  
  1689.     Usage    : path [-gr] [dir...dir]
  1690.  
  1691.     Without arguments, lists AmigaDOS path. Otherwise adds given
  1692.     directories to the path, preventing duplicate entries.
  1693.  
  1694.     Options    :
  1695.      -r Resets the path
  1696.      -g Global path modifications; operations (add, reset) apply to all
  1697.          CLI processes instead of only the current one
  1698.  
  1699.     Note:
  1700.     It's not perfectly "legal" to modify the path-list of other
  1701.     processes. Adding entries (option -g) works fine in most cases.
  1702.     But the removal of entries (options -gr together) may crash the
  1703.     system, because CSH doesn't know about the memory handling of
  1704.     other processes (it doesn't know how they allocated the memory
  1705.     for the path-list entries).
  1706.  
  1707.     So use option -g always with care (at least together with -r).
  1708.     If it works, it's okay. If not, you lose ;-)  There's no 100%
  1709.     reliable way for global path modifications.
  1710.  
  1711.     PRI
  1712.  
  1713.     Usage    : pri clinumber pri
  1714.     Example    : pri 3 5    # set priority of cli #3 to 5
  1715.  
  1716.     Change the priority of the specified task (use PS command to
  1717.     determine clinumber). If you specify 0 as clinumber you can
  1718.     change priority of "this" task (the one executing shell).
  1719.  
  1720.     PROTECT
  1721.  
  1722.     Usage    : protect file1 ... filen [u|g|o|a][+|-|=][flags]
  1723.     Example    : protect myfile u+rwe
  1724.  
  1725.     Set AmigaDOS file protection flags for the file specified.
  1726.     Valid flags are h, s, p, a, r, w, e, d.  (x is the same as e)
  1727.  
  1728.     Ownership:
  1729.       u  Set specified bits for User
  1730.       g  Set specified bits for Group
  1731.       o  Set specified bits for Other (not User, not Group)
  1732.       a  all, alias for "ugo" (User/Group/Other)
  1733.     Specifying no ownership is equal to 'u'.
  1734.  
  1735.     Modes:
  1736.       +  Set specified bits, leave all others
  1737.       -  Clear specified bits, leave all others
  1738.       =  Set specified bits, clear all others
  1739.     Specifying no mode is equal to '='.
  1740.  
  1741.     Archive bit cleared by default!
  1742.  
  1743.     Note: This command is equivalent to "chmod" except that the
  1744.           arguments for filename(s) and flag(s) are reversed.
  1745.  
  1746.     PS
  1747.  
  1748.     Usage    : ps [-les] [commandname...commandname]
  1749.  
  1750.     Options    :
  1751.      -l shows full pathnames of commands
  1752.      -e excludes the given command names from the list
  1753.      -s don't show stacksize and type, use old output-format instead
  1754.  
  1755.     Gives status of CLI processes.  eg:
  1756.  
  1757.     Proc Command Name         Typ  Stack  Pri.  Address  Directory
  1758.     * 1  csh                  fr   10000    0      97b0  Stuff:shell
  1759.       2  clock                bw    4096  -10    2101a8  Workdisk:
  1760.       3  emacs                bw   30000    0    212f58  Stuff:shell
  1761.       4  VT100                bw    4000    0    227328  Workdisk:
  1762.  
  1763.     Address is the address of the task, directory is the process
  1764.     currently CD'd directory. My default, only the BaseNames of
  1765.     the commands are shown. Your own CLI will be marked by an
  1766.     asterisk in the first column.
  1767.  
  1768.     Stack size is the _real_ size of a command's stack. It's _not_
  1769.     the size a program gets if it's launched by this command.  Use
  1770.     "Status" instead if you need the size of the Default Stack.
  1771.     (be aware: "Status" does _not_ show the stack size used by a prog!)
  1772.  
  1773.     Typ are two letters.  The first is either "f" (foreground) or
  1774.     "b" (background).  The second is one of:
  1775.         i: invalid
  1776.         a: added
  1777.         r: running / ready to run
  1778.         w: waiting
  1779.         e: except
  1780.         d: removed
  1781.  
  1782.     PWD
  1783.  
  1784.     Usage    : pwd
  1785.  
  1786.     Rebuild _cwd by backtracing from your current directory.
  1787.  
  1788.     QSORT
  1789.  
  1790.     Usage    : qsort [-cr] <in >out
  1791.  
  1792.     Options    :
  1793.      -c case-sensitive
  1794.      -r reverse sort
  1795.  
  1796.     Quick sorts from stdin to stdout (case-insensitive).
  1797.  
  1798.     QUIT
  1799.  
  1800.     Usage    : quit
  1801.  
  1802.     Quit out of Shell back to CLI.
  1803.  
  1804.     RBACK
  1805.  
  1806.     Usage    : rback command
  1807.  
  1808.     Start a new process executing the specified command, but can't do
  1809.     input/output. Equivalent to 'run command >NIL: <NIL:'. Instead of
  1810.     using rback, you can add a '&' at the end of the command line.
  1811.  
  1812.     Note: rback cannot start builtin commands. You have to start a
  1813.           subshell: rback csh -c "copy ram:temp prt:;rm ram:temp
  1814.  
  1815.     READFILE
  1816.  
  1817.     Usage    : readfile varname [filename]
  1818.  
  1819.     Completely reads an ASCII file and assigns it to a variable. Each
  1820.     line becomes one word in the resulting string. Embedded blanks
  1821.     are no problem. If file name is omitted, stdin is used. See also
  1822.     'writefile', @subfile and @flines
  1823.  
  1824.     REHASH
  1825.  
  1826.     Usage    : rehash [-cglos]
  1827.  
  1828.     Options    :
  1829.      -c clear local program hash list
  1830.      -g clear global program hash list
  1831.      -l load global program hash list into local buffer
  1832.      -o output local program hash list
  1833.      -s save local program hash list to disk
  1834.  
  1835.     Scans the complete DOS search path (see also 'path') and builds a
  1836.     program hash list. This can be used for program name completion from
  1837.     command line (default: ESC-p, ESC-P). And when running commands
  1838.     CShell does not scan DOS search path any more for every command but
  1839.     instead scans the program hash list in memory (minimizes disk access
  1840.     and speeds up running commands significantly).
  1841.  
  1842.     Of course, when you add a directory to your path, when you add
  1843.     programs to the existing path or when you remove directories/programs
  1844.     then you have to rebuild the program hash list.
  1845.  
  1846.     Each invocation of CShell has its own local buffer to hold that
  1847.     program hash list.  Use option -s to save the local list to disk
  1848.     (csh:csh-prgs).  With option -l the list is loaded into memory.
  1849.     The first CShell loading the list puts a copy of it into a global
  1850.     buffer so that next time a CShell wants to load it the global buffer
  1851.     is used and not the disk file.
  1852.  
  1853.     The global list stays in memory -- even if you quit all CShells.
  1854.     Use option -g to free that global list (if you are low on memory),
  1855.     but this does not affect local lists of any currently running CShell.
  1856.     Option -c clears the local list.
  1857.  
  1858.     If you run this command without options the scanned list is not only
  1859.     put into local buffer but also in global buffer.
  1860.  
  1861.     There's no need to clear the local/global list before
  1862.     loading/building a new one. This is done automatically.
  1863.  
  1864.     The variable $_prghash (default: 'csh:csh-prgs') holds the filename
  1865.     where the program hash list is loaded from and saved to.
  1866.  
  1867.     Programs from the hash list are case in-sensitive and may be
  1868.     abbreviated. This can be toggled with the variable "_abbrev".
  1869.  
  1870.     Recommended usage:
  1871.     First run "rehash" from your shell to build the program hash list.
  1872.     Save this list to disk with "rehash -s".  Now include "rehash -l"
  1873.     in "s:.cshrc" to load this list on every invocation of CShell.
  1874.  
  1875.     RELABEL
  1876.  
  1877.     Usage    : relabel drive name
  1878.     Example    : relabel DH0: Picard
  1879.  
  1880.     Change the volume name of the disk in the given drive to the name
  1881.     specified. Volume names are set initially when you format a disk.
  1882.  
  1883.     If you have a floppy disk system with only one disk drive, be sure
  1884.     to specify the disks by volume name, instead of drive name.
  1885.  
  1886.     RENAME (or MV)
  1887.  
  1888.     Usage    : rename [-fv] from to
  1889.     or    : rename [-fv] from from from ... from todir
  1890.  
  1891.     Options    :
  1892.      -f don't abort on errors
  1893.      -v verbose mode (print renamed filenames)
  1894.  
  1895.     Allows you to rename a file or move it around within a disk.
  1896.     Allows you to move 1 or more files into a single directory.
  1897.     The archive bit of the file(s) will be cleared.
  1898.  
  1899.  
  1900.     RESIDENT
  1901.  
  1902.     Usage    : resident [-dr] [files]
  1903.     Example    : resident lc1 lc2 blink    # load these as resident
  1904.           resident -d lc1 lc2 blink    # defer load when needed
  1905.           resident -r lc1 lc2 blink    # remove these
  1906.           resident            # list resident programs
  1907.  
  1908.  
  1909.     Options    :
  1910.      -d deferred load;
  1911.      -r remove files from resident list
  1912.  
  1913.     This is DOS resident. Commands are searched by Shell in resident
  1914.     list BEFORE of searching on any external device.
  1915.     Only PURE programs can run as resident, see DOS docs for more info.
  1916.     Option -d is very useful: you can say, in your startup file,
  1917.     resident -d file...file; programs will not be loaded immediately,
  1918.     but only when you will try to load them. This way, you will not
  1919.     waste memory and startup time if you don't use the programs.
  1920.     Old option -a has no more effect.
  1921.  
  1922.     RETURN
  1923.  
  1924.     Usage    : return [n]
  1925.     Example    : return 10
  1926.  
  1927.     Exit from a script file, or quit from shell with optional
  1928.     exit code.
  1929.  
  1930.     RM (or DELETE)
  1931.  
  1932.     Equivalent to DELETE.
  1933.  
  1934.     RPN
  1935.  
  1936.     Usage    : rpn expression
  1937.     Example    : rpn 3 7 *    # Prints the value 21
  1938.  
  1939.     Evaluate an RPN expression, using 32-bit values. In older versions
  1940.     of Shell RPN contained string functions too, but now that strings
  1941.     are handled by specifical commands, these are no more needed.
  1942.     At end of evaluation, RPN prints values on stack, so you can
  1943.     say for instance "rpn $x 2 * | input x" to double the value of
  1944.     variable x.
  1945.     Functions implemented are:
  1946.  
  1947.         + - * /    Obvious meaning; / means integer division, of course
  1948.         %        Module operator e.g. "rpn 7 3 %" answers 1
  1949.         & | ~    Bitwise and, or, not operators
  1950.         > < ==    Tests for greater-than, lower-than, equal. To get
  1951.             a test for >= (or <=), you can use < ! (or > !)
  1952.         !        Logical not operator
  1953.         DUP        Duplicate value on top of stack
  1954.         DROP    Drop value on top of stack
  1955.         SWAP    Swap two values on top of stack
  1956.  
  1957.     To avoid confusion with redirections, > and < operators must be
  1958.     enclosed in quotes e.g.
  1959.  
  1960.         3 2 ">"        # Prints 1
  1961.  
  1962.     RUN
  1963.  
  1964.     Usage    : run prgm args
  1965.     Example    : run emacs test.c
  1966.  
  1967.     Start a new process executing the specified command. This command is
  1968.     not fully reliable: use at your own risk.  See also rback.
  1969.  
  1970.     RXREC
  1971.  
  1972.     Usage    : rxrec [portname]
  1973.  
  1974.     Create an AREXX-compatible port of the specified name (defaults to
  1975.     "rexx_csh"), then puts Shell to sleep waiting for messages on it.
  1976.  
  1977.     CAUTION: the only way to exit from this status is to send to the
  1978.     port the message "bye".
  1979.  
  1980.     Example:
  1981.     Open two Shell's in two separate CLI's. From the first, type:
  1982.  
  1983.         rxrec
  1984.  
  1985.     Now first Shell doesn't respond to keyboard input; instead, it waits
  1986.     for messages on a port called "rexx_csh". Now, from the other, type:
  1987.  
  1988.         rxsend rexx_csh "dir df0:"
  1989.  
  1990.     You will see the listing of df0: in the first Shell.  Experiment as
  1991.     you like, then:
  1992.  
  1993.         rxsend rexx_csh bye
  1994.  
  1995.     And all will return to normal.
  1996.  
  1997.     RXSEND
  1998.  
  1999.     Usage    : rxsend [-lr] portname command...command
  2000.  
  2001.     Options    :
  2002.      -r set the variable _result to the result string of the
  2003.         AREXX command.
  2004.      -l send the whole line as *one* command.
  2005.  
  2006.     Send commands to any program with an AREXX-compatible port. Be aware
  2007.     that every word is sent as a single command!
  2008.  
  2009.     You don't have to load anything to use these command (or rxrec):
  2010.     all you need is a program with the right port.
  2011.  
  2012.     An example is CygnusEdProfessional: here is, for instance, a command
  2013.     to wake it up, load the file test.c and jump to line 20:
  2014.  
  2015.         rxsend rexx_ced cedtofront "open test.c" "jmp to line 20"
  2016.         # rexx_ced is the name of AREXX port for CygnusEd
  2017.  
  2018.  
  2019.     Refer to your application manual for details and for the names
  2020.     of the commands and the port.
  2021.  
  2022.     SEARCH
  2023.  
  2024.     Usage    : search [-abceflnoqrvw] file...file string
  2025.  
  2026.     Search specified files for a string. Only lines containing the
  2027.     specified strings are displayed.
  2028.  
  2029.     If the filename is STDIN (in uppercase), the standard input is
  2030.     used, so you can use search as the destination for a pipe.
  2031.     Example:
  2032.         strings myprog * | search STDIN .library
  2033.     Lists all libraries used in "myprog".
  2034.  
  2035.     Search is very fast if none of the options -w, -e and STDIN was
  2036.     specified and the file fits into memory.
  2037.  
  2038.     Options    :
  2039.       -a (abort)   stops search as soon as the pattern was found once
  2040.       -b (binary)  shows only byte offsets instead of lines. If combined
  2041.                    with -n, shows naked numbers.
  2042.       -c (case)    turns ON case sensitivity
  2043.       -e (exclude) lists lines NOT containing the pattern
  2044.       -f (files)   causes only the names of the files in which the pat-
  2045.                    tern was found to be displayed.
  2046.       -l (left)    pattern must be at beginning of line (this is faster
  2047.                    than using a wild card)
  2048.       -n (number)  turns off line numbering
  2049.       -o (only)    finds only whole words
  2050.       -q (quiet)   suppresses printing of file names.
  2051.       -r (recurse) if you specify any directory, all files in that di-
  2052.                    rectory are recursively searched.
  2053.       -v (verbose) shows each file name on a single line. this is auto-
  2054.                    matically turned on if search is redirected
  2055.       -w (wild)    wild card matching. see notes below
  2056.  
  2057.     Notes to wild card matching;
  2058.     - Uses Shell standard matching.
  2059.     - All standard DOS wildcards are allowed * ? [] () | ~ ' #
  2060.     - The WHOLE line must match the string, not only a substring.
  2061.     - String MUST be enclosed in quotes to avoid wildcard expansion
  2062.  
  2063.     Examples:
  2064.         search -cr df0:include ACCESS
  2065.     Find all occurrences of ACCESS (in uppercase) in all files
  2066.     contained in include directory.
  2067.         search -w shell.h "'#define*"
  2068.     Lists only lines of file beginning with (not simply containing)
  2069.     #define. Note the use of ' to escape the special symbol #.
  2070.  
  2071.     SET
  2072.  
  2073.     Usage    : set [name] [=] [string]
  2074.     Example    : set abc hello
  2075.  
  2076.     Set with no args lists all current variable settings.
  2077.     Set with one arg lists the setting for that particular variable.
  2078.     Specifying name and string, stores the string into variable name.
  2079.  
  2080.     Also see the section on special _variables.
  2081.  
  2082.     SETENV
  2083.  
  2084.     Usage    : setenv envvar value
  2085.  
  2086.     Sets an ENV: variable to the given value. The value must be
  2087.     enclosed in quotes if it contains spaces. To retrieve an ENV:
  2088.     variable, just use $envvar anywhere on a command line.
  2089.  
  2090.     SLEEP
  2091.  
  2092.     Usage    : sleep [-t] timeout
  2093.     Example    : sleep 10
  2094.  
  2095.     Options    :
  2096.      -t Specify timeout in ticks (50 per second) instead of seconds
  2097.  
  2098.     Sleep for 'timeout' seconds, or until ^C typed.
  2099.  
  2100.     SOURCE
  2101.  
  2102.     Usage    : source file [arguments]
  2103.     Example    : source mymake.sh all
  2104.     Result    : batch file 'mymake.sh' called with var _passed = 'all'
  2105.  
  2106.     Execute commands from a file.  You can create SHELL programs in
  2107.     a file and then execute them with this command.  Source'd files
  2108.     have the added advantage that you can have loops in your command
  2109.     files (see GOTO and LABEL).  You can pass SOURCE files arguments
  2110.     by specifying arguments after the file name.  Arguments are passed
  2111.     via the _passed variable (as a single string, a set of words).
  2112.     See _failat variable for script aborting.
  2113.  
  2114.     Long lines may be split by appending a backslash (\) at end of
  2115.     first part. One single line must be shorter than 512 bytes, but
  2116.     the concatenated line can be as long as you want. There is no
  2117.     limit on the length of the concatenated line.
  2118.  
  2119.     Automatic 'sourcing' is accomplished by appending a .sh suffix to
  2120.     the file (no need to set the s-bit) and executing it as you would
  2121.     a C program:
  2122.  
  2123.     --------- file hello.sh ---------
  2124.     foreach i ( $_passed ) "echo yo $i"
  2125.     ---------------------------------
  2126.  
  2127.     $ hello a b c
  2128.     yo a
  2129.     yo b
  2130.     yo c
  2131.  
  2132.     If the last character of a line in a source file is '{', all
  2133.     following lines will appended to the current one and separated
  2134.     by semicolons until the last character of a line is '}'. Those
  2135.     blocks may be nested. You may use comments and unterminated
  2136.     strings within.
  2137.  
  2138.     --------- file login.sh ---------
  2139.     alias complex {
  2140.       echo -n "this alias
  2141.       echo " works!"
  2142.     }
  2143.     ---------------------------------
  2144.  
  2145.     $ login
  2146.     $ complex
  2147.     this   alias   works!
  2148.  
  2149.     SPLIT
  2150.  
  2151.     Usage    : split srcvar dstvar...dstvar
  2152.  
  2153.     Assigns one word of srcvar to every dstvar, the rest of srcvar to
  2154.     the last dstvar.
  2155.     Note: You enter variable NAMES, not variables.
  2156.  
  2157.     STACK
  2158.  
  2159.     Usage    : stack [number]
  2160.     Example    : stack [-s] 8000
  2161.  
  2162.     Options    :
  2163.      -s prints size only (pure number, no text).
  2164.  
  2165.     Changes the default stack for this CLI.
  2166.     Without arguments, just prints it.
  2167.  
  2168.     STRHEAD
  2169.  
  2170.     Usage    : strhead varname breakchar string
  2171.     Example    : strhead x "." foobar.bas    # Will set x to "foobar",
  2172.                                           # . must be quoted!
  2173.  
  2174.     Remove everything after and including the breakchar in 'string' and
  2175.     place in variable 'varname'. See also command "STRTAIL".
  2176.  
  2177.     STRINGS
  2178.  
  2179.     Usage    : strings [-bnrv] [file1..fileN] [minlength]
  2180.     Example    : strings [-bnrv] c:dir c:list shell 7
  2181.  
  2182.     Options    :
  2183.      -r  if you specify any directory, all files in that directory
  2184.          are recursively searched for strings
  2185.      -n  print name of current file in front of each string
  2186.      -b  shows each string enclosed by  '|' characters, so as to expose
  2187.          leading and trailing spaces or tabs.
  2188.      -v  verbose output before each file (filename, minlength)
  2189.  
  2190.     Prints strings contained in specified files (usually binary)
  2191.     with length >= minlength.  Default is 4.
  2192.  
  2193.     You cannot use a filename that represents a number as last
  2194.     argument. If there are no filenames specified, standard input
  2195.     is used, so you can use strings as the destination for a pipe.
  2196.  
  2197.     STRLEFT
  2198.  
  2199.     Usage    : strleft varname string n
  2200.     Example    : strleft x LongString 5    # Will set x to "LongS"
  2201.  
  2202.     Place leftmost n chars of string in variable varname.
  2203.  
  2204.     STRLEN
  2205.  
  2206.     Usage    : strlen varname string
  2207.     Example    : strlen x Hello        # Will set x to "5"
  2208.  
  2209.     Puts len of string in variable varname.
  2210.  
  2211.     STRMID
  2212.  
  2213.     Usage    : strmid varname string n1 [n2]
  2214.     Example    : strmid x LongString 5 3    # Will set x to "Str"
  2215.  
  2216.     Places n2 chars from string, starting at n1, in variable varname.
  2217.     By omitting n2, you get all chars from n1 to end of string.
  2218.  
  2219.     STRRIGHT
  2220.  
  2221.     Usage    : strright varname string n
  2222.     Example    : strright x LongString 5    # Will set x to "tring"
  2223.  
  2224.     Place rightmost n chars of string in variable varname.
  2225.  
  2226.     STRTAIL
  2227.  
  2228.     Usage    : strtail varname breakchar string
  2229.     Example    : strtail x "." foobar.bas    # Will set x to "bas",
  2230.                                           # . must be quoted!
  2231.  
  2232.     Remove everything before and including the breakchar in 'string' and
  2233.     place in variable 'varname'. See also command "STRHEAD".
  2234.  
  2235.     TACKON (or ADDPART)
  2236.  
  2237.     Usage    : tackon var pathname filename
  2238.     Example    : tackon x df0:c Dir    # sets x to "df0:c/Dir"
  2239.     or    : tackon x df0: Preferences #sets x to "df0:Preferences"
  2240.  
  2241.     Correctly  adds  a  filename  to a pathname, and puts the result in
  2242.     variable specified.
  2243.  
  2244.     TAIL
  2245.  
  2246.     Usage    : tail [filename] [num]
  2247.     Example    : tail readme 20
  2248.  
  2249.     Display last "num" lines of "filename".    If num is not specified,
  2250.     10 is assumed. If filename is not specified, standard input (stdin)
  2251.     is taken instead.
  2252.  
  2253.     TEE
  2254.  
  2255.     Usage    : tee [file]
  2256.     Example    : cc test.c | tee >error.list
  2257.  
  2258.     Copies stdin to stdout and the given file.
  2259.     If file is omitted, stderr is used.
  2260.  
  2261.     TOUCH
  2262.  
  2263.     Usage    : touch file1 .. fileN
  2264.  
  2265.     Sets DateStamp of the specified files to the current date & resets
  2266.     archive bit.
  2267.  
  2268.     If a file doesn't exist, touch will create an empty one for you.
  2269.  
  2270.     TRUNCATE
  2271.  
  2272.     Usage    : truncate [n]
  2273.     Example : alias | qsort | truncate
  2274.  
  2275.     A filter that truncates the width of stdin to the specified number,
  2276.     trying to account for tab's and escape sequences. If the number is
  2277.     omitted, the current window width is used.
  2278.  
  2279.     TYPE (or CAT)
  2280.  
  2281.     Equivalent to CAT.
  2282.  
  2283.     UNALIAS
  2284.  
  2285.     Usage    : unalias name .. name
  2286.     Example    : unalias vt
  2287.  
  2288.     Delete aliases..
  2289.  
  2290.     UNIQ
  2291.  
  2292.     Usage    : uniq
  2293.  
  2294.     This is a  filter that removes consecutive, duplicated lines in a
  2295.     file.  It is most useful on a sorted file.
  2296.  
  2297.     UNSET
  2298.  
  2299.     Usage    : unset name .. name
  2300.     Example    : unset abc
  2301.  
  2302.     Unset one or more variables.  Deletes them entirely.
  2303.  
  2304.     USAGE
  2305.  
  2306.     Usage    : usage [command...command]
  2307.  
  2308.     If called without arguments, usage gives you a short information
  2309.     on the special characters used. Otherwise, usage shows you the
  2310.     usage of the given commands. Calling a command with a '?' as
  2311.     the only argument will show its usage, too.
  2312.  
  2313.     VERSION
  2314.  
  2315.     Usage    : version [-filr] [name]
  2316.     Example    : version -fl libs:eazytools.library c:dir
  2317.  
  2318.     Options    :
  2319.      -f don't look in memory, force load of FILE
  2320.      -i INTERNAL (?)
  2321.      -l show FULL version information
  2322.      -r RES (?)
  2323.  
  2324.     Without arguments shows current version and state of Cshell
  2325.     including the individual authors. You also get the current
  2326.     version of the operation system.
  2327.  
  2328.     With arguments you get the version and revision number of each
  2329.     named object. See your AmigaDOS manual for details on version
  2330.     information. The options correspond to the options of Commodore's
  2331.     "version" command (which is launched internally ;-)
  2332.  
  2333.     WAITFORPORT
  2334.  
  2335.     Usage    : waitforport portname [seconds]
  2336.     Example    : waitforport rexx_ced 5
  2337.  
  2338.     Waits for a port to come up. Default time is 10 seconds.
  2339.  
  2340.     WHEREIS
  2341.  
  2342.     Usage    : whereis [-r] filename [ device1...deviceN ]
  2343.  
  2344.     Options    :
  2345.      -r look on all drives.
  2346.  
  2347.     If just a file name is given, whereis searches all subdirectories of
  2348.     the current directory for that file. An asterisk '*' is appended to
  2349.     the file. Wild cards are allowed for the file (no asterisk will be
  2350.     appended then), but no path names. If additional arguments are
  2351.     given, whereis searches only these paths, not the current directory.
  2352.  
  2353.     WINDOW
  2354.  
  2355.     Usage    : window [-fblsaq] [dimensions]
  2356.  
  2357.     Options    :
  2358.         -f    (front) Window to front
  2359.         -b    (back)  Window to back
  2360.         -l    (large) Window to maximum size
  2361.         -s    (small) Window to minimum size
  2362.         -a    (activate)
  2363.         -q    (query) Lists screens and windows open
  2364.         -w    (width) Ignore window width for option "-q" (query)
  2365.         -k    KingCON kludge (try this if you use KingCON)
  2366.  
  2367.     Various operations on CLI window. If dimensions are specified,
  2368.     they must be in the form x y width height, with values separated by
  2369.     spaces. Use dimension -1 for maximum value (eg, "window -1 -1 -1 -1"
  2370.     is equivalent to "window -l"), and -2 for keeping current value.
  2371.  
  2372.     The command "window -l" may be very useful on PAL machines to get
  2373.     a full PAL window from your login sequence, or if you use overscan
  2374.     WorkBench.
  2375.  
  2376.     Option -q gives, for each Screen and Window currently open,
  2377.     title, left edge, top edge, width, height, (depth).
  2378.  
  2379.     NOTE: Some options of this command may not work properly with the
  2380.     console handler KingCON. This is a problem with KingCON which does
  2381.     not send or intercept IDCMP_CHANGEWINDOW messages. Try option "-k"
  2382.     (KingCON kludge) if you use KingCON and have problems.
  2383.  
  2384.     WRITEFILE
  2385.  
  2386.     Usage: writefile varname
  2387.  
  2388.     Writes a set of words to stdout, one word per line. Note that the
  2389.     name of the variable (var) must be supplied, not the value ($var).
  2390.  
  2391.  
  2392. IX. SPECIAL VARIABLES
  2393. ---------------------
  2394.  
  2395. There are a number variables, the write variable, that have a side effect on
  2396. your system (e.g.  changing the title bar), and some others, the read
  2397. variables, that tell you something about your environment (e.g.  the current
  2398. shell version).  You can also overlay the write variables with a local
  2399. variable, so any change only takes place while the current context is
  2400. valid.
  2401.  
  2402. LIST OF VARIABLES:
  2403. ------------------
  2404.  
  2405.     _abbrev
  2406.     Holds a number which lets you select the various modes of
  2407.     command-abbreviation:
  2408.  
  2409.       0   internal commands and commands buffered with "rehash"
  2410.           can no longer be abbreviated  (same as "unset _abbrev")
  2411.       1   internal commands can be abbreviated
  2412.       2   commands buffered with "rehash" can be abbreviated,
  2413.           the first (partially) matching command from the list is taken
  2414.       4   commands buffered with "rehash" can be abbreviated,
  2415.           if the command matches a buffered command completely,
  2416.           then this is taken, else the first partially matching
  2417.           command from the list is taken
  2418.       8   if command wasn't found in Cshell's internal program list
  2419.           (built with "rehash"), then search DOS path-list
  2420.  
  2421.     Numbers can be added to combine modes.
  2422.  
  2423.     The main difference between '2' and '4' is that '2' does not
  2424.     recognize a completely matching command if it has already
  2425.     found a partially matching command earlier in the list.  Eg,
  2426.     you type "ed" and you have (in this order) "EdPlayer" and
  2427.     "Ed" in your list, then "Ed" can never be called (except with
  2428.     absolute path). So '4' first seeks for a completely matching
  2429.     command -- and if it cannot find anything then (and only then)
  2430.     it searches for an abbreviated command.
  2431.  
  2432.     Thus it makes obviously no sense to use '2' and '4' together.
  2433.  
  2434.     By default, this variable is set to '5' (1+4).
  2435.  
  2436.     _bground
  2437.     True if the shell was started with a non-interactive input.
  2438.  
  2439.     _clinumber
  2440.     Contains the number (1-20) of current CLI.
  2441.  
  2442.     _clipri
  2443.     Task priority while editing command line.
  2444.     (also affects filename completion)
  2445.  
  2446.     _complete
  2447.     This variable holds a DOS pattern. What files should match on
  2448.     filename completion. Default is "*" (show all files). For example,
  2449.     if you don't want to see files ending with ".o" and ".bak", set it
  2450.     to "~(*.o|*.bak)".
  2451.  
  2452.     This is similar to the variable "fignore" known from Unix (t)csh,
  2453.     except that fignore is limited to extensions only and - on the
  2454.     contrary to "_complete" - specifies which files should NOT be
  2455.     listed.
  2456.  
  2457.     _cquote
  2458.     If set to some value, quotation marks are handled as
  2459.     Commodore-Shell does, so that they are parsable by ReadArgs()
  2460.     (function call in dos.library). Commodore-Shell treats quotes
  2461.     within a string "as as". Only leading quotation marks "quote"
  2462.     other special chars (like spaces). In contrast to UNIX shells
  2463.     where quotation marks always "quote" other chars - regardless
  2464.     of their position. UNIX behavior (_cquote unset) is default.
  2465.  
  2466.     _cwd
  2467.     Holds a string representing the current directory we are in from
  2468.     root.  The SHELL can get confused as to its current directory if
  2469.     some external program changes the directory.  Use PWD to rebuild
  2470.     the _cwd variable in these cases.
  2471.  
  2472.     _debug
  2473.     Debug mode... use it if you dare.  must be set to some value
  2474.  
  2475.     _dirformat
  2476.     Holds a format string for option -z of builtin command "dir".
  2477.     Used to keep aliases short and to bypass problems with dir's
  2478.     format option "-z" (eg, it's not possible to specify other options
  2479.     after -z without using @pickargs/@pickopts).
  2480.  
  2481.     The format string is limited to a maximum of 80 characters.
  2482.  
  2483.     _every
  2484.     Contains the name of a command that is to be executed every time
  2485.     just before the prompt is printed. Do not use this to echo the
  2486.     prompt.
  2487.  
  2488.     _except
  2489.     See EXCEPTION
  2490.  
  2491.     _failat
  2492.     If a command returns with an error code higher than this, the
  2493.     batch file aborts. The default is 20.
  2494.  
  2495.     _hilite
  2496.     Holds the font attributes used for highlighting. One letter for one
  2497.     attribute:
  2498.       b    for bold
  2499.       i    for italic
  2500.       u    for underlined
  2501.       r    for reverse
  2502.       c3   for foreground color 3
  2503.       c3,2 for foreground color 3 and background color 2
  2504.     Any combinations are allowed. _hilite defaults to "c7", in terminal
  2505.     mode to "r".
  2506.  
  2507.     _history
  2508.     This variable is set to a numerical value, and specifies how far
  2509.     back your history should extend. Set it to 0 to disable history,
  2510.     for example if you test your programs for memory leaks. Defaults
  2511.     to 50.
  2512.  
  2513.     _insert
  2514.     Sets the default for insert/overtype mode for command line editing.
  2515.     ESC-i toggles between, but after <RET> the default is set back as
  2516.     indicated by this variable. By default _insert is 1, unsetting
  2517.     _insert will make overtype the default.
  2518.  
  2519.     _ioerr
  2520.     Contains the secondary error code for the last command. Will be
  2521.     changed after every external command and after a failed internal
  2522.     command. See @ioerr( )
  2523.  
  2524.     _kick
  2525.     holds version number of Operating System (version.library),
  2526.     eg, 37, 38, 39, 40, ...
  2527.  
  2528.     _kick2x
  2529.     True if exec.library V37+ could be opened
  2530.     (which means that kickstart 2.0 is around)
  2531.  
  2532.     _kick3x
  2533.     True if exec.library V39+ could be opened
  2534.     (which means that kickstart 3.0 is around)
  2535.  
  2536.     _lasterr
  2537.     Return code of last command executed.  This includes internal
  2538.     commands as well as external comands, so to use this variables
  2539.     you must check it IMMEDIATELY after the command in question.
  2540.  
  2541.     _lcd
  2542.     Holds the name of the last directory. The builtin alias 'dswap'
  2543.     cd's to that directory. If called again, you're back where you
  2544.     were.
  2545.  
  2546.     _man
  2547.     The path and name of your .doc files. Defaults to 'csh:csh.doc'
  2548.  
  2549.     _mappath
  2550.     Cshell allows invocation of foreign shells if a script starts with
  2551.     "#!" or ";!" followed by a command to execute.  To use unmodified
  2552.     Unix scripts pathname-mapping is necessary to convert pathes like
  2553.     "/usr/..." to, eg, "usr:...".  Set _mappath to enable this name-
  2554.     mapping.  By default _mappath is unset ("/usr/" would be inter-
  2555.     preted as relative AmigaDOS path).
  2556.  
  2557.     _maxerr
  2558.     The worst (highest) return value to date.  To use this, you usually
  2559.     set it to '0', then do some set of commands, then check it.
  2560.  
  2561.     _minrows
  2562.     Gives the minimum number of rows a window must have to turn on quick
  2563.     scrolling. Defaults to 34.
  2564.  
  2565.     _nobreak
  2566.     If set to some value, disables CTRL-C.
  2567.  
  2568.     _nomatch
  2569.     If set to some value, don't check patterns if they match.
  2570.     (By default CSH aborts command execution if all patterns does not
  2571.      match. If at least one pattern matches CSH does not abort.)
  2572.  
  2573.     _noreq
  2574.     If set to some value, disables system requesters ("Please insert
  2575.     volume ...."). Turned on in vt200 mode.
  2576.  
  2577.     _passed
  2578.     This variable contains the passed arguments when you SOURCE a file
  2579.     or execute a .sh file.  For instance:
  2580.  
  2581.     test a b c d
  2582.  
  2583.     -------- file test.sh ----------
  2584.     echo $_passed
  2585.     foreach i ( $_passed ) "echo YO $i"
  2586.     --------------------------------
  2587.  
  2588.     _path
  2589.     Tells CShell where to look for executable files. The current direc-
  2590.     tory and the AmigaDOS path will be searched first. The trailing
  2591.     slash for directories is not necessary any more.  The entire path
  2592.     will be searched first for the <command>, then for <command>.sh
  2593.     (automatic shell script sourcing). Example:
  2594.         set _path ram:c,ram:,sys:system,dh1:tools,df0:c
  2595.     (This path has the advantage that these directories need not even
  2596.      exist, that you can access devices (AmigaDOS path only knows
  2597.      volumes under Kick 1.3) and that no disk seeks happen at startup)
  2598.  
  2599.     The usage of _path is NOT recommended anymore, use the AmigaDOS
  2600.     search path instead (builtin command "path").
  2601.  
  2602.     _prghash
  2603.     The filename where the program hash list (command 'rehash')
  2604.     is loaded from and saved to.
  2605.  
  2606.     _prompt
  2607.     This variable now can contain the following control characters:
  2608.      %c  for color change. This highlights your prompt. See _hilite
  2609.      %e  for elapsed time. The time the last command took to execute.
  2610.      %m  for memory. This shows your current memory in K
  2611.      %t  for time. This shows your current time in the format HH:MM:SS
  2612.      %d  for date. This shows the current date in the format DD-MMM-YY
  2613.      %p  for path. This inserts the complete current path
  2614.      %P  for path. This inserts the current path (see also _promptdep)
  2615.      %V  for volume. This inserts the current volume
  2616.      %n  for number. This inserts the current process number
  2617.      %v  for version. This shows the version number of CShell
  2618.      %h  for history. This displays the current history number
  2619.      %f  for free store. This shows the free store on the current drive
  2620.      %r  for pRiority. Inserts the task priority of the current
  2621.      %s  for shells open. Inserts the result of 'howmany'
  2622.      %U  for user. Shows current user (only with "MultiUser" package)
  2623.      %x  for external cmd return code. Yields the last error code
  2624.     The default for prompt is now "%c%p> "
  2625.     The  if  command  will  set the prompt to a '_ ' if commands are
  2626.     disabled while waiting for a 'endif' or 'else' command (interactive
  2627.     mode only).
  2628.  
  2629.     _promptdep
  2630.     Prompt path depth. Holds the maximum number of directories (path
  2631.     parts counting from the right) displayed for "%P" (see _prompt) to
  2632.     keep prompt smart and short. _promptdep must be greater 0.
  2633.     The internal default for "%P" is to display 3 directories.
  2634.  
  2635.     The missing path components will be marked with "...". The path
  2636.     components won't be replaced with "..." if the three dots don't
  2637.     make the path shorter.
  2638.  
  2639.     _pipe
  2640.     The directory where temporaries are stored. Default: 'T:'
  2641.  
  2642.     _qcd
  2643.     Holds the name of the file where the all directories on your hard
  2644.     disk are stored. If not set, disables quick cd-ing.
  2645.  
  2646.     _rback
  2647.     Is the name of the command to be the prepended to the command line
  2648.     when '&' was added to it. Defaults to 'rback', can't be a multi
  2649.     word command yet.
  2650.  
  2651.     _rxpath
  2652.     The same as with _path, but this is where CShell looks for .rexx
  2653.     files. Defaults to REXX:
  2654.  
  2655.     _scroll
  2656.     Holds the number of lines to be scrolled at once when quick
  2657.     scrolling is used. If unset or <=1, quick scrolling is off.
  2658.     Defaults to 3.
  2659.  
  2660.     _terminal
  2661.     Indicates whether or not shell was started in terminal mode.
  2662.  
  2663.     _timeout
  2664.     Set the timeout period (in microsends) for the connected terminal to
  2665.     respond to a WINDOW STATUS REQUEST (special Amiga control sequence
  2666.     to get window bounds). Only used in terminal mode, of course.
  2667.  
  2668.     For local usage a small value is sufficient, for remote usage (eg,
  2669.     over a serial line) the value should be much higher (eg, 500000,
  2670.     which a 1/2 second).
  2671.  
  2672.     _titlebar
  2673.     The same control characters as for the _prompt can be used for
  2674.     _titlebar, too. The only difference is that %c is ignored. The
  2675.     titlebar is updated every time before the prompt appears.
  2676.  
  2677.     _verbose
  2678.     If set to 's', turns on verbose mode for source files (every command
  2679.     will be displayed before being executed). If set to 'a', displays
  2680.     all substeps while alias substitution. 'h' will hilight the debug
  2681.     output. Any combination allowed: set _verbose sah
  2682.  
  2683.     _version
  2684.     Contains the version number of the shell, e.g. 510.
  2685.  
  2686.  
  2687. X.   FUNCTIONS
  2688. --------------
  2689.  
  2690.     FUNCTIONS
  2691.     Functions are preceded by an @-sign and may not be abbreviated
  2692.     They must be preceded by a blank and a blank must follow the opening
  2693.     and precede the closing parenthesis. There must be no blank between
  2694.     the function name an the opening parenthesis. Example:
  2695.        echo @info( df0: )
  2696.     (NOTE: Later versions of Shell might allow that functions need not
  2697.            be at the beginning of an argument, so quote any @-signs not
  2698.            used for functions)
  2699.  
  2700.     Functions may be nested. The function names themselves are case
  2701.     sensitive, but the operations (like strcmp) aren't.
  2702.  
  2703.     Functions can be used as commands. They will echo their return value
  2704.     to stdout. Note that they can't be abbreviated and that the function
  2705.     list is searched after the command list. Example:
  2706.         drives          ---> DF0: DH1: DH2: RAM: WB_2.x:
  2707.     Therefore, functions can also be used like this:
  2708.         echo $(drives)
  2709.  
  2710.     So far, functions are not user definable.
  2711.  
  2712.     Note the difference between sets of words and strings. After
  2713.       set var hello world
  2714.     $var is a wordset, but after
  2715.       set var "hello world"
  2716.     var is one string. Although they look the same if echoed, they
  2717.     behave different, for example in 'foreach i ( var ) "echo hi'. The
  2718.     functions @split and @concat convert the two forms.
  2719.  
  2720.  
  2721. LIST OF FUNCTIONS:
  2722. ------------------
  2723.  
  2724.     @abbrev( str1 str2 [len] )
  2725.     true if the first <len> chars of str1 are an abbreviation of str2
  2726.     @abs( num )
  2727.     returns absolute value of <num>
  2728.     @age( file )
  2729.     the age of that file in days, null-string if file not found
  2730.     @age_mins()
  2731.     the age of that file in minutes, null-string if file not found
  2732.     @appsuff( name suffix )
  2733.     appends an suffix ( .ZOO ) to a string if it's not already there
  2734.     @arg( arg ... arg )
  2735.     see @pickargs( )
  2736.     @ask( title item ... item )
  2737.     asks for confirmation of every item and returns the confirmed ones
  2738.     (very similar to @confirm(), but default is negative)
  2739.     @availmem( [type] )
  2740.     returns free 'chip', 'fast' or otherwise total memory
  2741.     @basename( path ... path )
  2742.     returns the file name parts of the paths
  2743.     @center( word len )
  2744.     returns a string of length <len> with <word> centered in it
  2745.     @checkport( portname )
  2746.     indicates if given port exists
  2747.     @clinum( procname )
  2748.     returns the number of the cli identified by a name or a number
  2749.     @complete( abbrev word ... word )
  2750.     returns the first word <abbrev> is an abbreviation of
  2751.     @concat( word word ... word )
  2752.     concats all words in one blank separated string, see @split
  2753.     @confirm( title item ... item )
  2754.     asks for confirmation of every item and returns the confirmed ones
  2755.     (very similar to @ask(), but default is positive)
  2756.     @console( STDIN|STDOUT )
  2757.     tells whether stdin or stdout are interactive (not redirected)
  2758.     @dectohex( number )
  2759.     returns a string representing <number> in hex
  2760.     @delword( word word ... word n )
  2761.     returns a string with the n-th word deleted.
  2762.     @delwords( word word ... word n m )
  2763.     deletes the next m words from the n-th.
  2764.     @dirname( path )
  2765.     strips the base name from a path, just returns the directory
  2766.     @dirs( name name name name )
  2767.     returns the directories among the given file names, see @files
  2768.     @dirstr( lformat file )
  2769.     returns any info (size, date, file comment) about a file
  2770.     @drive( path )
  2771.     outputs the drive ( device ) name associated to <path>
  2772.     @drives( )
  2773.     outputs all available drives
  2774.     @exists( file )
  2775.     tells whether a file exists or not
  2776.     @fileblks( file file ... file )
  2777.     returns the # of blocks needed for the files, incl. dir blocks
  2778.     @filedate( file )
  2779.     returns a string representing the date of the given file
  2780.     @fileinfo
  2781.     Equivalent to @dirstr
  2782.     @filelen( file file ... file )
  2783.     count the total number of bytes of the given files
  2784.     @filenote( file )
  2785.     returns filenote of given file
  2786.     @fileprot( file )
  2787.     returns a string like ---arwed
  2788.     @filereq( title path&pattern filename )
  2789.     brings up the ASL file requester and returns the selected file name
  2790.     @files( file file ... file )
  2791.     gives you the files among those names, no directories. see @dirs
  2792.     @filesize
  2793.     Equivalent to @filelen
  2794.     @flines( varname )
  2795.     counts the number of lines in a readfile-file (faster than @words)
  2796.     @freebytes( path )
  2797.     the number of free bytes on the given path
  2798.     @freeblks( path )
  2799.     the number of free blocks on the given path
  2800.     @freestore( path )
  2801.     the amount of free store on that path, given in K, M and G
  2802.     @getenv( varname )
  2803.     returns the value of the named env: variable
  2804.     @getclass( file )
  2805.     returns the class (type) of the file. See chapter XIV
  2806.     @hextodec( hex-number )
  2807.     returns a string representing <hex-number> in dec
  2808.     @howmany( )
  2809.     indicates the # of shells running
  2810.     @index( string pattern )
  2811.     returns the index of pattern in string (starting at 1),
  2812.     0 if not found
  2813.     @info( path )
  2814.     the corresponding line from the 'info' command, each entry a word
  2815.     @intersect( word1 word2 word3 , word4 word5 word6 )
  2816.     returns all words which are in both lists. see @union, @member
  2817.     @ioerr( num )
  2818.     returns the corresponding error string to num
  2819.     @lookfor( file paths )
  2820.     looks for a file in the current directory and the paths. See $_path
  2821.     @lower
  2822.     lowercases its arguments. see @upper
  2823.     @match( word ... word "pattern" )
  2824.     returns the words in the list that match the DOS-pattern
  2825.     @max( num num ... num )
  2826.     computes the maximum of all given numbers
  2827.     @megs( number )
  2828.     expresses a number in K, M and G (-bytes), rounded correctly
  2829.     @member( word1 word word ... word )
  2830.     tells you if word1 is among the remaining words
  2831.     @min( num num ... num )
  2832.     computes the minimum of all given numbers
  2833.     @mix( arg1 ... argn )
  2834.     randomly mixes its arguments
  2835.     @mounted( device )
  2836.     returns a boolean indicating whether the specified device is mounted,
  2837.     (don't add an extra colon ':' at the end)
  2838.     @nameext( filename )
  2839.     returns all after the last dot of <filename>.
  2840.     @nameroot( filename )
  2841.     returns all before the LAST dot of <filename>.
  2842.     @opt( arg ... arg )
  2843.     see @pickopts( )
  2844.     @pathname( path )
  2845.     obsolete. use @dirname
  2846.     @pickargs( arg ... arg )
  2847.     picks of its arguments those which don't start with a '-'
  2848.     @pickopts( arg ... arg )
  2849.     picks of its arguments those which start which a '-'
  2850.     @rnd( seed )
  2851.     returns a 32 bit random number (default seed is 1);
  2852.     'seed' is optional and can be used to set new seed for @rnd( ),
  2853.     if you use seed=0 then CSH takes current system time as seed
  2854.     @rpn( expression )
  2855.     computes the rpn expression. See rpn command
  2856.     @scrheight( )
  2857.     outputs the current height of the screen the shell is running in
  2858.     @scrwidth( )
  2859.     outputs the current width of the screen the shell is running in
  2860.     @sortargs( name ... name )
  2861.     sorts its arguments alphabetically
  2862.     @sortnum( number ... number )
  2863.     sorts its arguments numerically
  2864.     @split( string )
  2865.     makes each blank separated part of @string a word, see @concat
  2866.     @strcmp( name name )
  2867.     returns -1, 0 or 1 depending of alphabetical comparison
  2868.     (case-sensitive)
  2869.     @stricmp( name name )
  2870.     returns -1, 0 or 1 depending of alphabetical comparison
  2871.     (case-insensitive)
  2872.     @strhead( breakchar string )
  2873.     see strhead command
  2874.     @strleft( string number )
  2875.     see strleft command
  2876.     @strmid( string n1 n2 )
  2877.     see strmid command
  2878.     @strright( string n )
  2879.     see strright command
  2880.     @strtail( breakchar string )
  2881.     see strtail command
  2882.     @subfile( varname n m )
  2883.     like @subwords, but acts on a readfile-file and is faster
  2884.     @subwords( word ... word n m )
  2885.     returns the next m words word of the given list starting from n
  2886.     @tackon( path file )
  2887.     see tackon command
  2888.     @trim( word word word )
  2889.     removes all leading and trailing blanks from the words
  2890.     @unique( word ... word )
  2891.     sorts the arguments and makes each of them unique
  2892.     @union( name ... name , name ... name )
  2893.     returns all names that are in either list. See @intersect, @member
  2894.     @upper( word ... word )
  2895.     upper cases the given words. see @lower
  2896.     @volume( path )
  2897.     returns the volume name in that path or ""
  2898.     @wincols( )
  2899.     returns the number of columns in the current shell window
  2900.     @winheight( )
  2901.     outputs the height of your window in pixels
  2902.     @winleft( )
  2903.     returns the left edge of your window
  2904.     @winrows( )
  2905.     returns the number of lines in the current shell window
  2906.     @wintop( )
  2907.     returns the top edge of your window
  2908.     @winwidth( )
  2909.     outputs the width of your window in pixels
  2910.     @without( name ... name , name ... name )
  2911.     returns all names of list 1 that are not in list 2
  2912.     @word( name ... name n )
  2913.     picks the n-th word from the list.
  2914.     @words( name ... name )
  2915.     returns the number of words in the list.
  2916.  
  2917.  
  2918. XI. MISCELLANEOUS
  2919. -----------------
  2920.  
  2921.     CShell now allows to do quick scrolling in large windows. Quick
  2922.     scrolling means that whenever the cursor reaches the bottom of
  2923.     the window, the text jumps up 3 or more lines at once. However,
  2924.     only the following commands support this:
  2925.         dir, cat, htype, strings, search, truncate, tee
  2926.     You can choose the number of lines to scroll at once by setting
  2927.     the variable _scroll. Unsetting it or setting it to a value <=1
  2928.     completely disables quick scrolling.
  2929.     You can also choose the number lines a window must at least have
  2930.     to turn on the quick scrolling by setting the _minrows variable.
  2931.     (Defaults to 34). Quick scrolling is automatically disabled when
  2932.     the command is redirected. By piping any command to cat, you can
  2933.     force it to quick scroll. Example:  List | cat
  2934.  
  2935.     CShell now can be terminated using the closing gadget in the
  2936.     AmigaDOS 2.0 shell window. Don't execute c:ENDCLI while using
  2937.     the shell. This can cause problems with external commands. The
  2938.     closing button provides a 'quit' command. You can define
  2939.       alias quit "Endcli;\\quit
  2940.     to assert that the CLI window closes when you click the button.
  2941.  
  2942.  
  2943.     EXCEPTIONS
  2944.     If  no  _except variable exists, any command which fails causes the
  2945.     rest of the line to abort as if an ABORTLINE had been executed.  If
  2946.     the _except variable exists, it is of the form:
  2947.  
  2948.     "nnn;commands..."
  2949.  
  2950.     where  nnn  is  some  value  representing  the  minimum return code
  2951.     required  to  cause  an  error.   Whenever a command returns a code
  2952.     which  is  larger  or  equal  to  nnn,  the commands in _except are
  2953.     executed  before  anything.   WHEN _except EXISTS, THE COMMAND LINE
  2954.     DOES  NOT  ABORT AUTOMATICALLY.  Thus, if you want the current line
  2955.     being executed to be aborted, the last command in _except should be
  2956.     an "abortline".
  2957.  
  2958.     Exception  handling  is  disabled  while  in the exception handling
  2959.     routine (thus you can't get into any infinite loops this way).
  2960.  
  2961.     Thus if _except = ";", return codes are completely ignored.
  2962.  
  2963.     Example:
  2964.  
  2965.     set _except "20;abortline"
  2966.  
  2967.  
  2968. XII. EXAMPLE SOURCE FILES
  2969. -------------------------
  2970.  
  2971. If from a CLI or the startup-script you say 'SHELL filename', that file is
  2972. sourced first.
  2973.  
  2974. ### compat.sh ###
  2975.  
  2976. # this makes sure that your old abbreviations don't call new commands
  2977.  
  2978. alias as  aset
  2979. alias cl  close
  2980. alias g   goto
  2981. alias h   help
  2982. alias he  help
  2983. alias m   md
  2984. alias q   quit
  2985. alias re  rename
  2986. alias w   window
  2987.  
  2988. alias kr  "rm -r ram:* >NIL:
  2989.  
  2990. ### End of compat.sh ###
  2991.  
  2992.  
  2993. Moreover, if you have a file called S:.cshrc, it will be sourced for every
  2994. Shell you run. This is useful for aliases and setting that you want in ALL
  2995. Shells.
  2996.  
  2997.  
  2998. ### Example S:.cshrc ###
  2999.  
  3000. Here is an example .cshrc file:
  3001.  
  3002. set F5 "cdir WORK:"^M
  3003. set f9 "ed s:login.sh"^M
  3004. set F9 "ed df0:s/startup-sequence"^M
  3005.  
  3006. alias toram  "%q foreach i ( $q ) \"cp -r $i: ram:$i >NIL:;assign $i: ram:$i
  3007. alias ramop  "md RAM:op; assign OP: ram:op
  3008. alias noop   "assign OP: ; rm -r ram:op
  3009. alias newop  "rm -r OP:*
  3010. alias dc     "dfc df0: to df1:
  3011. alias go     "%q assign WORK: Boot:$q; cd WORK:; source startme.sh
  3012. alias get    "%q cp $q RAM: >NIL:
  3013. alias filter "%a%b%c exec $b \\<$a \\>$c
  3014.     # reads $a, filters it with $b and writes result to $c
  3015.  
  3016. alias rm     "%q \\rm @confirm( Remove $q )
  3017. # or if you want a more safe one
  3018. alias qrm    "%q \\rm @ask( Remove $q )
  3019.  
  3020. #alias rm     "%a set f @pickargs( $a );set opts @pickargs( $a );\
  3021. # e -n OK to delete @words( @files( $f ) ) file(s) and @words( @dirs( $f ) )\
  3022. # directories\"? \";input b;if $b = y;\\rm $opts $f;endif
  3023. #        # for the anxious among us: confirmed rm
  3024.  
  3025. set _prompt   "%c%p> "
  3026.     # this puts the path highlighted in the prompt
  3027.  
  3028. # this one puts cli number, free mem, date and time in title bar
  3029. set _titlebar "Shell %n    Mem %m     Date %d    Time %t
  3030.  
  3031. # This file will be sourced for every Shell you start
  3032.  
  3033. ### End of example .cshrc ###
  3034.  
  3035. ****************************************************************************
  3036.  
  3037. If you are a CLI user, your startup-sequence may be as simple as:
  3038.  
  3039.     C:csh S:startup.sh
  3040.  
  3041. Here's a startup code:
  3042.  
  3043. ### Example S:startup.sh ###
  3044.  
  3045. wind -l    # if you are on a PAL machine, or use overscan
  3046.     # note that commands may be abbreviated (wind=window)
  3047.  
  3048. assign LC: Stuff:c  INCLUDE: Stuff:include   LIB: Boot:lib   QUAD: RAM:
  3049.  
  3050. rback C:FaccII; sleep 1
  3051.     # after spawning a process, it is always better to allow it
  3052.     # to load the command, to avoid excessive drive head movement
  3053.  
  3054. resident -d blink lc1 lc2 >NIL:    #defer loading
  3055.  
  3056. C:PopCli 300 C:Newcli         #using full pathname loads faster
  3057. C:FF -1 Siesta.font >NIL:
  3058. C:Patch_1 >NIL:
  3059. stack 8000            # lc1 and lc2 need this
  3060.  
  3061. source S:setdate.sh        # this is listed next
  3062.  
  3063. ### End of example startup.sh ###
  3064.  
  3065. ****************************************************************************
  3066.  
  3067. The following is an example source file to set date and time; it may be
  3068. used at startup if you don't have an internal clock.
  3069.  
  3070. ### setdate.sh ###
  3071.  
  3072. open CON:200/100/440/80/SetDate write 1
  3073. echo >.1 -n "Current date is "
  3074. date >.1
  3075. echo >.1 -n "Please enter date: "
  3076. input <.1 d
  3077. close 1
  3078. strlen len $d
  3079. if $len > 1 ; date $d ; endif
  3080. echo -n "New date: " ; date
  3081.  
  3082. ### End of setdate.sh ###
  3083.  
  3084. ***************************************************************************
  3085.  
  3086. Next comes a makefile that needs no Make program: may be executed from
  3087. Shell directly!!!
  3088.  
  3089. ### make.sh ###
  3090.  
  3091. if -t Shell.syms Shell.h; cc +HShell.syms Shell.h; rm shell.o; endif
  3092. if -t RAM:Shell.syms Shell.syms; cp -d Shell.syms RAM:; endif
  3093.  
  3094. foreach i ( main comm1 comm2 comm3 execom globals rawconsole run set \
  3095.  sub ) "if -t $i.o $i.c; echo Compile $i...;cc +IRAM:shell.syms $i.c; endif"
  3096.  
  3097. # we used line continuation for better visibility. this is not necessary,
  3098. # you can type it all in one line. no more limit of 256 bytes per line
  3099.  
  3100. if -t Shell run.o main.o comm1.o comm2.o comm3.o execom.o \
  3101. set.o sub.o globals.o rawconsole.o
  3102.     ln  +q -m -o Shell run.o main.o comm1.o comm2.o comm3.o\
  3103.     execom.o set.o sub.o globals.o rawconsole.o -la -lc
  3104. endif
  3105.  
  3106. ### End of make.sh ###
  3107.  
  3108.  
  3109. XIII.  DEFAULT VALUES
  3110. ---------------------
  3111.  
  3112. Some aliases are predefined whenever you start a new Shell. These are:
  3113.  
  3114.     CDIR
  3115.     Use "cdir directory" to clear the screen, set CD to directory,
  3116.     and list it.
  3117.  
  3118.     CLS
  3119.     Simply clear the screen.
  3120.  
  3121.     DSWAP
  3122.     Exchanges current and the previous current directory. For use in
  3123.     scripts as the symbol for last current directory may change.
  3124.  
  3125.     EXIT
  3126.     Leave Shell and exit CLI.
  3127.  
  3128.     MANLIST
  3129.     Display  a list of possible arguments to man.
  3130.  
  3131.     RX
  3132.     Executes a REXX script. Prevents unwanted starting of 'rxrec'.
  3133.  
  3134. Moreover, many variables have default values, and many function keys are
  3135. predefined. You can use set command to determine all of these.
  3136.  
  3137.  
  3138. XIV.  OBJECT ORIENTED FEATURES
  3139. ------------------------------
  3140.  
  3141. File classes are good for two things: Identifying files and command over-
  3142. loading. The latter means that the same command with files of different
  3143. type performs completely different actions.
  3144.  
  3145.     CLASSES OF FILES
  3146.  
  3147.     You can define a class of files using several 'class' commands.
  3148.     Here a simple example:
  3149.  
  3150.       class picture  suff=.pic suff=.iff suff=.ilbm
  3151.       class anim     suff=.anim
  3152.  
  3153.     From now on, everything with the suffix .pic, .iff or .ilbm will
  3154.     be identified as a picture. Please note that there may be no blanks
  3155.     between the names and the '=', and that blanks inside the names
  3156.     must be put in quotes. So these are the ways to identify a file:
  3157.  
  3158.       suff=.doc        True if the suffix of the file is .doc
  3159.       name=readme      True if the file is "readme"
  3160.       name="mod.*"     True if the name starts with 'mod.'
  3161.       offs=14,DC..C4FD True if the bytes starting at $14 are $DC,
  3162.                        anything, $C4, $FD  (all numbers hexadecimal!).
  3163.                        Each pair of dots means one byte ignored.
  3164.       chars            True if 90% of the bytes in the file are 32..127
  3165.                        or 9..13
  3166.       default          Always true, used to define the default type
  3167.  
  3168.     Note that only the first character is examined, so 's' = 'suff'.
  3169.     One class can be identified by more than one 'class' statement.
  3170.     They are looked at in the same sequence they were entered. So to
  3171.     make sure that an zoo archive misnamed as .lzh is identified
  3172.     correctly, use the following 'class' statements:
  3173.  
  3174.       class zoo offs=14,DCA7C4FD
  3175.       class lzh offs=2,2D6C68..2D
  3176.       class zoo suff=.zoo
  3177.       class lzh suff=.lzh
  3178.  
  3179.     Moreover, there is a builtin class 'dir', which means directory.
  3180.     Now we know many file types. But what to do with them? This is
  3181.     where we define 'actions'.
  3182.  
  3183.     ACTIONS ON CLASSES
  3184.  
  3185.     There may be one or more 'class' commands that define what actions
  3186.     need to be taken in various cases for that specific class:
  3187.  
  3188.       class zoo actions view="zoo -list" extr="zoo -extract"
  3189.       class lzh actions view="lz l"      extr="lz e"
  3190.  
  3191.     Whenever somebody tries to 'view' a test.zoo, the command
  3192.     'zoo -list test.zoo' will be issued, but if he tries to
  3193.     view test.lzh, then 'lz l test.lzh' will be executed. Note
  3194.     that any command supplied here goes through the normal csh
  3195.     parser, so AmigaDOS and csh paths will be searched. Aliases
  3196.     with arguments are allowed here, too, so whatever the user
  3197.     typed will be stored in the variable after the '%'.
  3198.  
  3199.     How do I tell a file that I want to 'view' it? There comes the
  3200.     second command used for object oriented features:
  3201.  
  3202.       action view test.zoo
  3203.  
  3204.     will first identify the type of that file and then apply, if
  3205.     possible, the 'view' action to it. Of course, this works best
  3206.     inside an alias:  alias v "action view" will define a v-command
  3207.     that views all types of files known to cshell. Similarly, you
  3208.     can define   alias xtr "action extr" and use this command to
  3209.     extract files from any type of archive.
  3210.     There is one action that will be sent to every file that you
  3211.     try to start but is not executable. This action is 'exec'.
  3212.     Assume you have defined the class 'picture', then after
  3213.  
  3214.       class picture actions view=Mostra exec=Mostra
  3215.  
  3216.     you can display a picture using Mostra by just typing its name.
  3217.     More builtin actions like 'rm' and 'dir' may be implemented,
  3218.     so don't use command names for action names.
  3219.  
  3220.     The batch file class.sh defines a few useful classes.
  3221.  
  3222.     SUPERCLASSES
  3223.  
  3224.     Assume you have a class for .c files, one for .h files, and
  3225.     one for .asm files. You might want to make the difference
  3226.     between them when identifying them, but in the end, they're
  3227.     all ASCII, aren't they? You can stat this with the command
  3228.  
  3229.       class c_source suff=.c is=ascii
  3230.  
  3231.     Now whenever an action on a file of the type c_source fails,
  3232.     the file is interpreted as of type ascii, and the same
  3233.     action is attemted again. This goes on until a class has no
  3234.     more superclass.
  3235.  
  3236.  
  3237. XV.     KEYMAPS
  3238. ---------------
  3239.  
  3240.     You define a keymap as a collection of key/function pairs. Both
  3241.     are given as numbers. There can be several keymaps which activate
  3242.     each other, but at first we only edit keymap 0, which is active
  3243.     at the beginning. All keys you define will eventually overwrite
  3244.     the old definitions in an existing keymap. Everything marked with
  3245.     a (*) is not yet implemented.
  3246.  
  3247.     KEYCODES
  3248.  
  3249.     1..255    The corresponding ASCII character
  3250.     256      Up Arrow
  3251.     257      Down Arrow
  3252.     258      Right Arrow
  3253.     259      Left Arrow
  3254.     260      Help
  3255.     261..270  F1..F10  (unshifted)
  3256.  
  3257.  
  3258.     Modifiers (add them to the key code)
  3259.  
  3260.     512       SHIFT (only necessary for arrows and fkeys)
  3261.     1024      ESC   (was pressed & released before this key)
  3262.  
  3263.     EDITFUNCTIONS
  3264.  
  3265.     - Movement      Move cursor...
  3266.      0  CursLeft    1 left
  3267.      1  CursRight   1 right
  3268.      2  WordLeft    1 word left
  3269.      3  WordRight   1 word right
  3270.      4  BegOfLine   to beginning of line
  3271.      5  EndOfLine   to end of line
  3272.  
  3273.     - Deleting      Delete...
  3274.     10  Backspace   char left from cursor
  3275.     11  Delete      char right from cursor
  3276.     12  BkspcWord   word left from cursor
  3277.     13  DelWord     word right from cursor
  3278.     14  DeleteToSOL to start of line
  3279.     15  DeleteToEOL to end of line
  3280.     16  DeleteLine  whole line
  3281.     17  DelScreen   whole screen and refresh current line
  3282.  
  3283.     - History insert
  3284.     20  Back        Move one line back in history
  3285.     21  Forward     Move one line forward in history
  3286.     22  Beg         Move to first line in history
  3287.     23  End         Move to last line in history
  3288.     24  Complete    History retrieve like '!'
  3289.     25  Exec        Execute history line & bring up next
  3290.     26  Tail        Insert previous line except first word
  3291.     27  Bottom      Go below last history command
  3292.     28  DupWord     Duplicates the last word on this line
  3293.     29  LastPrev    Insert last word of previous line
  3294.  
  3295.     - Completion
  3296.     30  Normal      Insert first matching file (or cycle)
  3297.     31  Partial     Insert common substring of all matching files
  3298.     32  All         Insert all matching files
  3299.     33  Directory   Find dir in quick cd list
  3300.     34  LastCD      Insert last current directory
  3301.     35  Show        Shows all matching files
  3302.     36  CompPrg1    Insert first matching program (or cycle)
  3303.     37  CompPrgAll  Shows all matching programs
  3304.  
  3305.     - Special
  3306.     40  Insert      Toggle Insert/Overwrite
  3307.     41  Quit        Silently perform 'quit'
  3308.     42  Help        Silently perform 'help'
  3309.     43  Refresh     Redraw current line
  3310.     44  Execute     Execute current line
  3311.     45  Leave       Edit new line, store this in hist
  3312.     46  EOF         Terminate shell
  3313.     47  NOP         Do nothing
  3314.     48  Echo^O      Echoes a ^O
  3315.     49  Beep        Echoes a ^G
  3316.  
  3317.     - Other
  3318.     50  Fkey        Execute command associated to last fkey
  3319.     51  Menu        Execute command associated to last menu
  3320.     52  Undo        Undoes last edit
  3321.     53  Repeat      Repeats last function
  3322.     54  SwapChar    Swaps the two chars left of cursor
  3323.     55  QuoteChar   Quote next char
  3324.  
  3325.  
  3326.     Command types
  3327.  
  3328.     0   +x      Editing function x, see above descriptions
  3329.     512 +x      Setmap x,     x=0..7
  3330.     1024+x      Insert key x, x=1..255
  3331.     1536+x      Macro x       x=1..15         (*)
  3332.     2048+x      String x      x=1..15         (*)
  3333.  
  3334.     Examples:
  3335.  
  3336.     keymap 0    66=49    # the  B key will beep
  3337.     keymap 0     2=16    # ^B key will erase line
  3338.     keymap 0  1122=35    # ESC-b will show matching files
  3339.     keymap 0 9=31 521=30 # Swaps TAB and SHIFT-TAB
  3340.  
  3341.     keymap 0 260=47      # do nothing on help
  3342.     keymap 0 12=17       # clear screen and refresh line on ^L
  3343.     keymap 0 18=29       # insert last word of prev line on ^R
  3344.  
  3345.  
  3346. XVI.    SCROLLING
  3347. -----------------
  3348.  
  3349. console.device
  3350. --------------
  3351.  
  3352. Ever wondered why Commodore's shell scroll a standard ASCII text file
  3353. very fast and why CSH scrolls (despite line-buffering in most commands)
  3354. the same text file at a noticable slower speed?
  3355.  
  3356. Now, first of all it must be said that CSH uses the same console
  3357. environment as Commodore's shell does.  So in fact both shells will
  3358. scroll at the SAME speed -- provided that they're configured in a
  3359. similar way.
  3360.  
  3361. Excerpt from "console" autodoc:
  3362.  
  3363. |     V39 console.device takes advantage of the ability to mask
  3364. |     bitplanes for faster scrolling, clearing, and rendering.
  3365. |     The actual number of bitplanes scrolled depends on which
  3366. |     colors you set via the SGR sequences.  For those using
  3367. |     the defaults of PEN color 1, and cell color 0, console.device
  3368. |     only needs to scroll 1 bitplane.  The actual number
  3369. |     of bitplanes scrolled is reset when ESCc is sent, and when
  3370. |     the console window is entirely cleared (e.g., FF).  In
  3371. |     general this should cause no compatability problems, unless
  3372. |     you are mixing console rendering with graphic.library calls
  3373. |     in the same portions of your window.  Console.device considers
  3374. |     the number of bitplanes it must scroll, and the screen display
  3375. |     depth so that interleaved bitplane scrolling can be taken
  3376. |     advantage of in cases where performance is not significantly
  3377. |     affected (interleaved scrolling, and masking are mutually
  3378. |     exclusive).  The determination of how many planes to scroll
  3379. |     is undefined, and may change in the future.
  3380.  
  3381. In other words:
  3382.  
  3383. After opening a window or sending ANSI sequences that clear the window
  3384. (ESC c, FF) the console.device checks how much bitplanes are in use.
  3385. The number of bitplanes depends on the number of colors used in this
  3386. window.
  3387.  
  3388. If there's only 1 color in use (this is default in Commodore's shell)
  3389. then console.device can perform very fast scrolling because only one
  3390. bitplane needs to be scrolled.
  3391.  
  3392. The scroll speed becomes slower the more colors you use.  Lots of
  3393. programs use at least one additional color by default.  This looks
  3394. nice but slows down scrolling.  Besides others, CSH is one of the
  3395. programs that make use of additional colors.  By default CSH has a
  3396. colored prompt.  And some internal commands like "dir" use a color
  3397. to highlight text.
  3398.  
  3399. With the variable "_hilite" you can control how CSH highlights text.
  3400. If you type "set _hilite b" then text will be highlighted by making
  3401. it bold.  See "man _hilite" for further information.
  3402.  
  3403. If you want really fast text scrolling then avoid using colors in text
  3404. output. For example, add "set _hilite b" in your "s:.cshrc" file.  And
  3405. configure other programs (like NewList, a very cool directory lister
  3406. by Phil Dietz) so that they don't use colored output.
  3407.  
  3408. If you have to use colored text (for any reason) then clear the window
  3409. as soon as possible to allow the console.device to re-enable fast text
  3410. scrolling.
  3411.  
  3412. ALWAYS REMEMBER:
  3413.  
  3414. To enable fast scrolling you must clear the screen (ESC c, FF) first.
  3415.  
  3416. As soon as you use more than one color in your text output,
  3417. console.device switches back to normal (slow) scrolling automatically.
  3418. Then you have to clear the screen manually to re-activate optimized
  3419. (fast) scrolling.
  3420.  
  3421.  
  3422. CpuBlit
  3423. -------
  3424.  
  3425. You're running CpuBlit and you wonder why under Kickstart 2.x text
  3426. scrolls faster than under Kickstart 3.x.
  3427.  
  3428. Check if you call CpuBlit with option "-b". This option MUST be set
  3429. to allow CpuBlit the handling of (so called) "broken" bitmaps.
  3430.  
  3431.